Environment:
Windows Server 2012 R2
Ruby: 2.5.3 (32 bit)
Rails: 5.1.6.1
mysql2: 0.5.2
Hosted in iis with HttpPlattformHandler wrapping puma 3.11.4
mysql Server Version 5.5 running on different machine
I use a simple Table "roles" with only name and id and only 6 entries
Firing up rails console and querying
Role.find_by_name('m2m').id
results on the first try in
ActiveRecord::StatementInvalid (Mysql2::Error: Unknown MySQL error: SELECT roles.* FROM roles WHERE roles.name = 'machine2machine' LIMIT 1)
results on the second try in
ActiveRecord::StatementInvalid (Mysql2::Error::ConnectionError: Lost connection to MySQL server during query: SELECT roles.* FROM.....
and from the third run onward it starts to work always as expected
Starting the rails console again, the behavior starts over again with the same errors.
If I query instead
Role.where(name: 'm2m').first.id
It works from the first run onwards.
Environment: Windows Server 2012 R2 Ruby: 2.5.3 (32 bit) Rails: 5.1.6.1 mysql2: 0.5.2 Hosted in iis with HttpPlattformHandler wrapping puma 3.11.4 mysql Server Version 5.5 running on different machine
I use a simple Table "roles" with only name and id and only 6 entries
Firing up rails console and querying
Role.find_by_name('m2m').id
results on the first try in ActiveRecord::StatementInvalid (Mysql2::Error: Unknown MySQL error: SELECT
roles
.* FROMroles
WHEREroles
.name
= 'machine2machine' LIMIT 1)results on the second try in ActiveRecord::StatementInvalid (Mysql2::Error::ConnectionError: Lost connection to MySQL server during query: SELECT
roles
.* FROM.....and from the third run onward it starts to work always as expected
Starting the rails console again, the behavior starts over again with the same errors.
If I query instead Role.where(name: 'm2m').first.id It works from the first run onwards.
Any clues what could go wrong here?
Regards Andreas