0 Replies Latest reply on Dec 6, 2011 1:00 PM by davestar

    Datasource connection issue JBoss 5.1

    davestar

      We are using Hibernate and JPA to access the database.  There is one particular query that is failing and is making the connection stale in the JBoss connection pool.  It throws the below exception.

       

      2011-12-06 08:56:12,747 WARN  [org.hibernate.util.JDBCExceptionReporter] (http-0.0.0.0-7777-31) SQL Error: 17410, SQLState: null

      2011-12-06 08:56:12,747 ERROR [org.hibernate.util.JDBCExceptionReporter] (http-0.0.0.0-7777-31) No more data to read from socket

      2011-12-06 08:56:12,747 ERROR [org.hibernate.ejb.AbstractEntityManagerImpl] (http-0.0.0.0-7777-31) Unable to mark for rollback on PersistenceException:

      java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] No such transaction!

      at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.setRollbackOnly(BaseTransaction.java:191)

      at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.setRollbackOnly(BaseTransactionManagerDelegate.java:123)

      at org.hibernate.ejb.AbstractEntityManagerImpl.markAsRollback(AbstractEntityManagerImpl.java:421)

      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:576)

      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)

      at com.rtddenver.dao.jpa.TiesEmployeesDaoJpa.getEmployeesByLocationSortedByEmployeeNumber(TiesEmployeesDaoJpa.java:80)

      at com.rtddenver.gwt.server.VoteServiceImpl.getEmployeesByLocationSortedByEmployeeNumber(VoteServiceImpl.java:869)

       

      Following this failure, somehow all other JPA queries that happen to use that stale connection fail as well with the below exception

       

       

      Caused by: java.sql.SQLException: OALL8 is in an inconsistent state

      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)

       

       

      I have the "background-validation" set to true now and the "Background Validation Millis" set to 5000.  My question is what does the validator do when it comes across this stale connection? does it close it or does it try to synch it with the database?

       

      Also, what are the ways I can address the actual issue?