Announcement Announcement Module
Collapse
No announcement yet.
"Closing a statement you left open" warning with jboss and ibatis Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "Closing a statement you left open" warning with jboss and ibatis

    Im using Spring with IBatis in an J2EE-Environment with EJB 2.x Session Beans. For every call an my Daos I get the JBoss warning "Closing a statement you left open, please do your own housekeeping". I dont know how to avoid this.

    Does anybody know what Im doing wrong?

    Here is my configuration:

    Code:
    <jee:jndi-lookup id="dataSource" jndi-name="java:PegasosDS" />
    <jee:jndi-lookup id="dataSourceBackoffice" jndi-name="java:PegasosBackOfficeDS" />
    
    
    <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
    		<property name="configLocation" value="com/XXXXXX/pegasos/dao/ibatis/SqlMapConfig.xml" />
    		<property name="dataSource" ref="dataSource" />
    </bean>
    
    <bean id="sqlMapClientBackoffice"
    		class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
    		<property name="configLocation"
    			value="com/XXXXXX/pegasos/dao/ibatis/backoffice/SqlMapBackOfficeConfig.xml" />
    		<property name="dataSource" ref="dataSourceBackoffice" />
    </bean>
    Im using CMT and no spring managed transactions.

    Here is the stacktrace:

    Code:
    2007-06-21 16:26:39,484 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'priceGroupDao' to allow for resolving potential circular references
    2007-06-21 16:26:39,484 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'sqlMapClient'
    2007-06-21 16:26:39,484 DEBUG [org.springframework.context.support.ClassPathXmlApplicationContext] Publishing event in context [org.springframework.context.support.ClassPathXmlApplicationContext@6f5913]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.ClassPathXmlApplicationContext@6f5913: display name [org.springframework.context.support.ClassPathXmlApplicationContext@6f5913]; startup date [Thu Jun 21 16:26:36 CEST 2007]; root of context hierarchy]
    2007-06-21 16:26:39,546 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Eagerly caching bean 'beanFactoryPegasos' to allow for resolving potential circular references
    2007-06-21 16:26:39,546 DEBUG [org.springframework.context.support.ClassPathXmlApplicationContext] Publishing event in context [org.springframework.context.support.ClassPathXmlApplicationContext@13a7323]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.ClassPathXmlApplicationContext@13a7323: display name [org.springframework.context.support.ClassPathXmlApplicationContext@13a7323]; startup date [Thu Jun 21 16:26:36 CEST 2007]; root of context hierarchy]
    2007-06-21 16:26:39,546 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'beanFactoryPegasos'
    2007-06-21 16:26:39,562 DEBUG [org.springframework.util.WeakReferenceMonitor] Monitoring handle [com.XXXXXX.pegasos.core.ejb.LoginServiceExporterBean@1390e5e] with release listener [org.springframework.ejb.support.AbstractEnterpriseBean$BeanFactoryReferenceReleaseListener@de7c85]
    2007-06-21 16:26:39,578 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'loginService'
    2007-06-21 16:26:39,578 DEBUG [org.springframework.util.WeakReferenceMonitor] Starting reference monitor thread
    2007-06-21 16:26:39,609 DEBUG [org.springframework.orm.ibatis.SqlMapClientTemplate] Opened SqlMapSession [com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl@73a225] for iBATIS operation
    2007-06-21 16:26:39,609 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource
    2007-06-21 16:26:39,609 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Fetching JDBC Connection from DataSource
    2007-06-21 16:26:39,656 DEBUG [org.springframework.orm.ibatis.SqlMapClientTemplate] Obtained JDBC Connection [org.jboss.resource.adapter.jdbc.WrappedConnection@aabc8c] for iBATIS operation
    2007-06-21 16:26:39,656 DEBUG [com.ibatis.sqlmap.engine.cache.CacheModel] Cache 'com_XXXXXX_pegasos_persistence_User.com_XXXXXX_pegasos_persistence_UserCache': cache miss
    2007-06-21 16:26:39,656 DEBUG [com.ibatis.sqlmap.engine.cache.CacheModel] Cache 'com_XXXXXX_pegasos_persistence_User.com_XXXXXX_pegasos_persistence_UserCache': stored object 'java.lang.Object@1bcc13e'
    2007-06-21 16:27:05,265 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Returning JDBC Connection to DataSource
    2007-06-21 16:27:11,265 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] Returning JDBC Connection to DataSource
    2007-06-21 16:27:13,265 WARN  [org.jboss.resource.adapter.jdbc.WrappedConnection] Closing a statement you left open, please do your own housekeeping
    java.lang.Throwable: STACKTRACE
       at org.jboss.resource.adapter.jdbc.WrappedConnection.registerStatement(WrappedConnection.java:576)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.<init>(WrappedStatement.java:62)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.<init>(WrappedPreparedStatement.java:56)
       at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:187)
       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:585)
       at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:168)
       at $Proxy270.prepareStatement(Unknown Source)
       at com.ibatis.sqlmap.engine.execution.SqlExecutor.prepareStatement(SqlExecutor.java:494)
       at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:176)
       at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
       at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
       at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
       at com.ibatis.sqlmap.engine.mapping.statement.CachingStatement.executeQueryForObject(CachingStatement.java:79)
       at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
       at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
       at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
       at org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:243)
       at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
       at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241)
       at com.XXXXXX.pegasos.dao.ibatis.UserDao.getByLogin(UserDao.java:38)
       at com.XXXXXX.pegasos.core.service.impl.LoginService.login(LoginService.java:67)
       at com.XXXXXX.pegasos.core.ejb.LoginServiceExporterBean.login(LoginServiceExporterBean.java:56)
       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:585)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
       at org.jboss.ejb.Container.invoke(Container.java:954)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    Thanks for your help!

  • #2
    I have solved the issue myself.

    The log entry was generated my some default properties configured in iBatis sqlmapconfig.xml.

    There was an entry like:

    Code:
    <sqlMapConfig>
    
      <settings 
          cacheModelsEnabled="true" useStatementNamespaces="false"
          />
    
    </settings>
    </sqlMapConfig>
    Both properties are defaults. Without these settings no warn log message was generated.

    I dont know why these settings causes such an issue.

    Comment

    Working...
    X