Hello,

unfortunately, SAP DB does not support setting the session timeout after a session
is connected. The statement.setQueryTimeout is little more than a no-op currently,
and if it would be supported, it would be more a parameter told to the database
to give evil long running statements early.

Don't know your application, but perhaps you may look whether your Servlet
container supports some kind of connection pool like e.g. Tomcat does, where
connections can be configured to be closed after being some time not used.

Regards
Alexander Schr�der
SAP Labs Berlin 

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 11, 2003 4:18 PM
> To: [EMAIL PROTECTED]
> Subject: Session Timeout with JDBC
> 
> 
> Hello,
> 
> I am using SAP-DB 7.3.0.25 with JDBC in JAVA-Servlets. When 
> the Servlet is
> loaded,
> it connects to the database. After a session timeout, the 
> servlet should
> automatically reconnect
> to the DB.
> 
> Now, when a session timeout occurs, a select statement always 
> needs 120
> seconds,
> until an SQLException occurs, although I set the queryTimeout 
> to 5 seconds:
> 
> My DBCheck-Method goes:
> 
> try
> {
>           Statement stmtTest;
>           ResultSet rsTest;
>           stmtTest=conn.createStatement();
>           stmtTest.setQueryTimeout(5);
>           rsTest=stmtTest.executeQuery("select ........");   
> // needs 120
> seconds
>           rsTest.close();
>           stmtTest.close();
> }
> catch (Exception e)
> {
>      reconnect .......
> }
> 
> How can I configure SAP-DB (or my JDBC-Connection), that the 
> SQLException
> is coming earlier?
> 
> Regards
> Uli
> ____________________________________________________
> Ulrich Lickert, Universitaetsklinikum Freiburg
> Klinikrechenzentrum, Agnesenstr. 6-8, D-79106 Freiburg
> Tel +49-761-270-2265   Fax +49-761-270-2066
> Email [EMAIL PROTECTED]
> WWW: http://www.uniklinik-freiburg.de/
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to