Hello, I am using Sybase Anywhere 12 with a java application. I connect to the db with jdbcTemplate and am using jconn4. I initially thought the issue was with the Idle connection parameter (even though it is set by default to 240 min). However I noticed in the documentation that Usage: "Anywhere except with TDS connections. TDS connections (including jConnect) ignore the SQL Anywhere Idle connection parameter." Why is my connection consistently dying after two hours and how do I modify the IDLE time for a TDS connection? Thanks. |
Sometimes you need a law degree to understand the documentation... fortunately, I once stayed at a Holiday Inn Express so we're all set! Connection parameters are used to set connection properties, and what you may be dealing with is a server property... SELECT @@VERSION, PROPERTY ( 'IdleTimeout' ) AS "Server Connection Idle Timeout", CONNECTION_PROPERTY ( 'IdleTimeout' ) AS "Connection Connection Idle Timeout" @@VERSION,Server Connection Idle Timeout,Connection Connection Idle Timeout '12.0.1.4231','240','0' Consider using dbsrv12 -ti 0 SELECT @@VERSION, PROPERTY ( 'IdleTimeout' ) AS "Server Connection Idle Timeout", CONNECTION_PROPERTY ( 'IdleTimeout' ) AS "Connection Connection Idle Timeout" @@VERSION,Server Connection Idle Timeout,Connection Connection Idle Timeout '12.0.1.4231','0','0' Just to add: You might also check whether liveness timeout (LTO) checking leads to closed connections. When debugging long running applications (say, batch imports), I usually add LTO=0 to the connection string in order to prevent the connection to be closed by the database server in case the program is paused by a breakpoint or the like... To clarify: That is different from idle timeout checking, and the latter is certainly relevant in your case because of the 240 minute default.
(27 Dec '19, 07:29)
Volker Barth
|