SQL Anywhere 11, JZ0C0: Connection is already closed

两盒软妹~` 提交于 2019-12-23 13:38:07

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/2591420/sql-anywhere-11-jz0c0-connection-is-already-closed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!