jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
461 stars 385 forks source link

ActiveRecord::JDBCError: timeout #1034

Closed IZaiarnyi closed 4 years ago

IZaiarnyi commented 5 years ago

Sometimes I've got the exception:

ActiveRecord::JDBCError: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host tested.host, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

Please advise how the timeout can be set for my 'activerecord-jdbcmssql-adapter' ?

Noone of bellow properties doesn't work: timeout: 60000 connect_timeout: 60000 read_timeout: 60000 write_timeout: 60000 checkout_timeout: 60000

kares commented 4 years ago

you should always consult your driver properties and than set those with the properties section e.g.

adapter: mssql
properties:
  connectTimeout: ...

also, AR-JDBC no longer support MS-SQL from this repository - there's a separate gem for that. as to whether some of the top level timeouts are mapped to the specific property depends on the gem