English 中文(简体)
SQL Anywhere 11, JZ0C0: Connection is already closed
原标题:

I develop am webservice based on apache tomcat 6.0.26, apache cxf 2.2.7, spring 3.0, hibernate 3.3 and sybase sqlanywhere 11. im using the latest JDBC Driver from SYBASE jconn.jar Version 6.

The persistence layer is based on spring + hibernate dao, the connection is configured via a JNDI datasoure (META-INF directory).

It seems that, during longer times of inactivity, the connection from the webservice to the database is closed.

Exception: java.sql.SQLException: JZ0C0: Connection is already closed.

最佳回答

By default, SQL Anywhere will close an inactive connection after four hours. To change this, you can specify IdleTimeout=x (or Idle=x) in your connection string, where x is the number of minutes after which the connection will be closed (0=never). Alternatively, you can reset the default on the server using the -ti x switch - again, x is in minutes.

问题回答

暂无回答




相关问题
OracleConnection throwing exception

I m learning how to work with Oracle and am using C#/Visual Studio. Just as a reference, I m following this simple tutorial, and have all the prerequisites done (database installed and ODAC with dev ...

MySql connection, can I leave it open?

Is it smart to keep the connection open throughout the entire session? I made a C# application that connects to a MySql database, the program both reads and writes to it and the application has to be ...

Creating a database connection pool

Need information on creating a connection pool to the database (irrespective of the database) , and how efficient they are? What are the conditions where they can enhance performance. How to create ...

Using a schema other than dbo in LinqToSql Designer

Is there a way to specify in a data connection or the LinqToSql Designer a schema? Whenever I go to setup a data connection for LinqToSql there doesn t seem to be anyway to specify a schema and I ...

热门标签