• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Websphere, Hibernate, SQL Server throws Stale Connection exception

 
Prabu Pidaran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Hibernate 3.0 and SQL Server and Websphere 6.1 in my web applicaiton. often I am getting com.ibm.websphere.ce.cm.StaleConnectionException: . I cudnt catch this exception in my code. It shows compilation error. Any possible solution or any workaround....??? Following is the error stack..

J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource jdbc/ASMOracleDB. The exception which was received is com.ibm.websphere.ce.cm.StaleConnectionException: No more data to read from socket:java.sql.SQLException: No more data to read from socket

0000003d AbstractBatch W org.hibernate.jdbc.AbstractBatcher closeQueryStatement exception clearing maxRows/queryTimeout
com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Statement is closed.
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.runtimeXIfNotClosed(WSJdbcStatement.java:1664)
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.getMaxRows(WSJdbcStatement.java:1133)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:225)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:162)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1683)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Any possible solution or any workaround....???

Example: Handling data access exceptions - StaleConnectionException


I cudnt catch this exception in my code. It shows compilation error.
We can help you if you tell us what that compilation error is.

Regards, Jan
 
Prabu Pidaran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for assistance Jan Cumps. But if i add

"catch(com.ibm.websphere.ce.cm.StaleConnectionException
sce)
{
//if a StaleConnectionException is caught
// rollback and retry the action
try {
tran.rollback();
} catch (java.lang.Exception e) {
//deal with exception
//in most cases, this can be ignored
}
"


am getting compilation error that "com.ibm.websphere.ce.cm.StaleConnectionException" cannot be resolved
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to add the library containing that class to your compile classpath.
The link that I provided you befor contains this text:
you might need to import the app_server_root/lib/util.jar file into the development environment to take advantage of code that is provided.
 
Prabu Pidaran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.. I have added the util jar into my workspace from Websphere lib. but still it throws the same error. I think that util.jar doesnt contain the staleconnecitonexcpeption.class
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic