1 Reply Latest reply on Jun 24, 2008 9:12 AM by Vicky Kak

    Connection handle is not associated with the Managed Connect

    Ramkumar Krishnan Newbie

      Hi All,
      I am running my batch application in jboss 4.2.2. I am getting the below exception frequently though not every time i run the batch job. I am using spring 2.5.4 and spring-batch 1.0.1. My database is Mysql 5.1.23.

      org.springframework.jdbc.UncategorizedSQLException : PreparedStatementCallback; uncategorized SQLException for SQL [SELECT COUNT(*) FROM BATCH_JOB_EXECUTION WHERE JOB_EXECUTION_ID = ?]; SQL state [null]; error code [0]; Connection handle is not currently associated with a ManagedConnection; nested exception is java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection

      I am using HibernateTransactionManager (Hibernate 3.2) in my application.

      This is my mysql-ds.xml
       <new-connection-sql>select 1 from dual</new-connection-sql>
       <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
       <exception-sorter-class-name> com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
       <valid-connection-checker-class-name> com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker </valid-connection-checker-class-name>
      <connection-property name="useOldAliasMetadataBehavior">true</connection-property>

      Do i need to change something in my ds.xml ? I checked the jboss documentation but i couldn't find any info on this issue

      Any fixes?

      Please let me know if you need more information from me. I badly need a fix for this.

      thanks in advance,