Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Timeout settings with Hana JDBC driver

$
0
0

Hello

 

You are developing a Java client to connect to one or several Hana DB instances ?

(with ngdbc.jar driver)

 

Then i strongly advise to set the proper connection timeout. Otherwise a hanging connection to one instance will make the DriverManager.getConnection(...) to block forever, in running state. (Thread.interrupt() inefficient) The "timeout" property passed to the driver will be completely useless.

 

The proper property to set is "communicationtimeout" (in milliseconds).

 

My case was a hanging connection to the DB : The socket succeeded to connect, but the DB did not give any answer to the few chunk of data posted by the connector. In that case, the socket remains open forever, blocking the thread and all subsequent connection attempts (because of synchronized methods).

 

I took the time to post this, because I think this topic is poorly documented and covered in the various forums.

 

Hope that helps

 

Ronan


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>