Announcement Announcement Module
Collapse
No announcement yet.
StaleConnectionException while accessing mutiple databases Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • StaleConnectionException while accessing mutiple databases

    I'm using Spring 1.2.8 , Hibernate 3.0 and Websphere 5.1 and found out some time I do get StaleException when application is running longer and it appears back and forth. I have found an link which says using an Interceptor around TransactionProxy we can get away with Exception as it tries to make connection with some x number of times until I achieve the result. This doesn't make sense to me. Why doesn';t setting the auto Commit to true fixes the issue. If any of you had found the resolution please let me know. Here is the stack trace that we get for these datasources.




    f082fa ConnectionEve A J2CA0056I
    : The Connection Manager received a fatal connection error from the Resource Adaptor for resource jdbc/xyz. The exception which was received is com.ibm.websphere.ce.cm.StaleConnectionException: Io exception: Connection reset
    f082fa JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 17002, SQLState: null
    f082fa JDBCException E net.sf.hibernate.util.JDBCExceptionReporter Io exception: Connection reset
    f082fa JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 17002, SQLState: null
    f082fa JDBCException E net.sf.hibernate.util.JDBCExceptionReporter Io exception: Connection reset
    f082fa BatcherImpl W net.sf.hibernate.impl.BatcherImpl exception clearing maxRows/queryTimeout
    f082fa BatcherImpl W net.sf.hibernate.impl.BatcherImpl TRAS0014I: The following exception was logged com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Statement is closed.
    at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.runtimeX IfNotClosed(WSJdbcStatement.java:952)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.getMaxRo ws(WSJdbcStatement.java:608)
    at net.sf.hibernate.impl.BatcherImpl.closeQueryStatem ent(BatcherImpl.java:149)
    at net.sf.hibernate.impl.BatcherImpl.closeQueryStatem ent(BatcherImpl.java:105)
    at net.sf.hibernate.loader.Loader.getResultSet(Loader .java:889)
    at net.sf.hibernate.hql.QueryTranslator.iterate(Query Translator.java:868)
    at net.sf.hibernate.impl.SessionImpl.iterate(SessionI mpl.java:1619)
    at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl. java:29)
    at org.springframework.orm.hibernate.HibernateTemplat e$25.doInHibernate(HibernateTemplate.java:837)
    at org.springframework.orm.hibernate.HibernateTemplat e.execute(HibernateTemplate.java:312)
    at org.springframework.orm.hibernate.HibernateTemplat e.iterate(HibernateTemplate.java:823)
    a

  • #2
    Auto commit is a different attr for controlling transactional behaviour. Stale connection is different.

    Comment


    • #3
      auto-commit is not related to your problem - autocommit should be always off especially when dealing with transactions.
      As for the your problem - the stacktrace states that you are using Hibernate 2.x while you speak of Hibernate 3.x. Make sure you are using the last stable libraries and try to isolate your problem.
      By the look of the exception, the connection pooling/database/network connection might be the problem.

      Comment


      • #4
        Thanks for the reply . I'm using hibernate 2.1.8 not 3.0. Afetr doing some reseach and I believe this issue can be fixed by setting preTestSqlString property in Websphere. This will make sure that after each transaction we get valid connection. Here are the steps to follow

        http://publib.boulder.ibm.com/infoce...etestconn.html

        Comment

        Working...
        X