ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Silmaril Feanor <silmarilfea...@yahoo.com>
Subject Connection.close() has already been called
Date Mon, 29 Sep 2008 19:55:39 GMT
Sorry if this goes through twice...

I sometimes get an exception related to "Connection.close() has already been called".  I
don't understand why this happens since I never call Connection.close() explicitly. 
Perhaps I need to change something in my configuration?

I am using MySQL 5.1,  ibatis 2.3.0.677,  MySQL Connector/J 5.1.6

Here's what my SqlMapConfig looks like:

<settings
        useStatementNamespaces="true"
        lazyLoadingEnabled="true"
    />
    <transactionManager type="JDBC">
        <dataSource type="SIMPLE">
              <property name="JDBC.Driver"
                value="${db.driver}"/>
              <property name="JDBC.ConnectionURL"
                value="${db.url}"/>
              <property name="JDBC.Username"
                value="${db.user}"/>
              <property name="JDBC.Password"
                value="${db.password}"/>
        </dataSource>
    </transactionManager>

Exception:

ERROR [main] - com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close()
has already been called. Invalid operation in this state.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
        at com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)
        at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4564)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:958)
        at $Proxy0.rollback(Unknown Source)
        at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.rollback(JdbcTransaction.java:72)
        at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(TransactionManager.java:105)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:782)
        at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:176)
        at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:154)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:883)
        at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:458)
        at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
        at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:59)
        at org.yeastrc.ms.dao.ibatis.BaseSqlMapDAO.saveAndReturnId(BaseSqlMapDAO.java:81)
        at org.yeastrc.ms.dao.general.ibatis.MsExperimentDAOImpl.saveExperiment(MsExperimentDAOImpl.java:45)
        at org.yeastrc.ms.service.MsDataUploader.saveExperiment(MsDataUploader.java:325)
        at org.yeastrc.ms.service.MsDataUploader.uploadExperimentToDb(MsDataUploader.java:99)
        at org.yeastrc.jqs.queue.MSJobExecutor.executeJob(MSJobExecutor.java:91)
        at org.yeastrc.jqs.queue.JobDispatcher.doJob(JobDispatcher.java:35)
        at org.yeastrc.jqs.program.JobProgram.findAndExecuteJobs(JobProgram.java:47)
        at org.yeastrc.jqs.program.JobProgram.runJobs(JobProgram.java:96)
        at org.yeastrc.jqs.program.JobProgram.main(JobProgram.java:129)


Thanks a lot for any suggestions.
-Ria



      
Mime
View raw message