1 Reply Latest reply on Sep 23, 2011 9:31 AM by Scott Marlow

    java.sql.SQLException: Invalid state, the PreparedStatement object is closed.

    Markus Dahm Novice

      Hi,

       

      when clicking a bit  through our application we sometimes get an expection like

       

      articlelist.xhtml]: javax.el.ELException: /pages/articlelist/artikelliste.xhtml @44,36 value="#{artikelListeController.artikelListe}": javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Invalid state, the PreparedStatement object is closed.
          at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:193) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:181) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.richfaces.component.UISequence.getValue(UISequence.java:177) [richfaces-components-ui-4.0.0.Final.jar:]
          at org.richfaces.component.UISequence.createExtendedDataModel(UISequence.java:112) [richfaces-components-ui-4.0.0.Final.jar:]
          at org.richfaces.component.UIDataTableBase.createExtendedDataModel(UIDataTableBase.java:197) [richfaces-components-ui-4.0.0.Final.jar:]
          at org.richfaces.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:462) [richfaces-components-ui-4.0.0.Final.jar:]
          at org.richfaces.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:277) [richfaces-components-ui-4.0.0.Final.jar:]
          at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1225) [richfaces-components-ui-4.0.0.Final.jar:]
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.richfaces.component.AbstractTogglePanel.visitTree(AbstractTogglePanel.java:735) [richfaces-components-ui-4.0.0.Final.jar:]
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.component.UIForm.visitTree(UIForm.java:326) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.richfaces.context.ExtendedPartialViewContextImpl.processPartialRenderPhase(ExtendedPartialViewContextImpl.java:284) [richfaces-core-impl-4.0.0.Final.jar:]
          at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:206) [richfaces-core-impl-4.0.0.Final.jar:]
          at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:388) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:159) [prettyfaces-jsf2-3.2.0.jar:]
          at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:115) [prettyfaces-jsf2-3.2.0.jar:]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
      Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Invalid state, the PreparedStatement object is closed.
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:158)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:237)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:363)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:219)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:35)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)
          at com.meyle.deva.dao.ArtikelDao$$$view13.searchByMeyleNummer(Unknown Source) [devA-dao-1.0-SNAPSHOT.jar:]
          at com.meyle.deva.business.ArtikelServiceBean.searchByText(ArtikelServiceBean.java:300) [devA-businesslogic-1.0-SNAPSHOT.jar:]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:44)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:233)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:363)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:219)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:35)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)
          at com.meyle.deva.artikel.ArtikelService$$$view16.searchByText(Unknown Source) [devA-businessinterface-1.0-SNAPSHOT.jar:]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at com.meyle.deva.business.ArtikelService$2141597694$Proxy$_$$_Weld$Proxy$.searchByText(ArtikelService$2141597694$Proxy$_$$_Weld$Proxy$.java) [weld-core-1.1.2.Final.jar:]
          at com.meyle.deva.web.controller.articlelist.ArtikelListeController.getArtikelListe(ArtikelListeController.java:80) [devA-webcontroller-1.0-SNAPSHOT.jar:]
          at com.meyle.deva.web.controller.articlelist.ArtikelListeController$Proxy$_$$_WeldClientProxy.getArtikelListe(ArtikelListeController$Proxy$_$$_WeldClientProxy.java) [devA-webcontroller-1.0-SNAPSHOT.jar:]
          at sun.reflect.GeneratedMethodAccessor306.invoke(Unknown Source) [:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
          at javax.el.BeanELResolver.getValue(BeanELResolver.java:302) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]
          at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          at org.apache.el.parser.AstValue.getValue(AstValue.java:134) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:55) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
          at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [jsf-impl-2.0.6.jar:2.0.6-FCS]
          ... 49 more
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Invalid state, the PreparedStatement object is closed.
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1344) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1277) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:261) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.ejb.criteria.CriteriaQueryCompiler$3.getResultList(CriteriaQueryCompiler.java:260) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]
          at com.meyle.deva.dao.ArtikelDaoBean.searchByNummer(ArtikelDaoBean.java:151) [devA-dao-1.0-SNAPSHOT.jar:]
          at com.meyle.deva.dao.ArtikelDaoBean.searchByMeyleNummer(ArtikelDaoBean.java:67) [devA-dao-1.0-SNAPSHOT.jar:]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:44)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)
          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:233)
          ... 125 more
      Caused by: org.hibernate.exception.GenericJDBCException: Invalid state, the PreparedStatement object is closed.
          at org.hibernate.exception.internal.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:148) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.exception.internal.SQLStateConverter.convert(SQLStateConverter.java:136) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:131) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:80) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at $Proxy173.setString(Unknown Source)    at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1.doBind(VarcharTypeDescriptor.java:57) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:82) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:305) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:300) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:65) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:588) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1758) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.doQuery(Loader.java:828) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.doList(Loader.java:2449) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.doList(Loader.java:2435) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.Loader.list(Loader.java:2271) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1105) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.internal.QueryImpl.list(QueryImpl.java:100) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]
          ... 155 more
      Caused by: java.sql.SQLException: Invalid state, the PreparedStatement object is closed.
          at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.checkOpen(JtdsPreparedStatement.java:187)
          at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.getParameter(JtdsPreparedStatement.java:337)
          at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.setParameter(JtdsPreparedStatement.java:409)
          at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.setString(JtdsPreparedStatement.java:689)
          at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.setString(CachedPreparedStatement.java:195)
          at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setString(WrappedPreparedStatement.java:637)
          at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source) [:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:124) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
          ... 176 more
      

       

      Since this occurs with different data bases I'm pretty sure it is not related to the driver or database itself.

      I have two suspects:

       

      1.) We are using the criteria API to create generic statements and always set the HINT org.hibernate.cacheable to true.

      This applies also for our @NamedQueries

       

      Maybe that is not allowed or causes problems with the statement cache...?

       

      2.) The configuration of the data source, which looks like this:

       

      <datasource jndi-name="java:jboss/datasources/Meyle-devA-DS" pool-name="Meyle-devA-DS" enabled="true"
                jta="true" use-java-context="true" use-ccm="true">
                <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                
                <connection-url>jdbc:jtds:sqlserver://foo.com</connection-url>
                <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
                <driver>net.sourceforge.jdts</driver>
                
                <pool>
                  <min-pool-size>10</min-pool-size>
                  <max-pool-size>50</max-pool-size>
                  <prefill>true</prefill>
                </pool>
                
                <security>
                  <user-name>PDP-DB-User</user-name>
                  <password>secret</password>
                </security>
                
                <statement>
                  <track-statements>true</track-statements>
                  <prepared-statement-cache-size>32</prepared-statement-cache-size>
                  <share-prepared-statements />
                </statement>
              </datasource>
      

       

      I have not tried yet to disable it, but I suspect that the

       

      <statement>
                  <track-statements>true</track-statements>
                  <prepared-statement-cache-size>32</prepared-statement-cache-size>
                  <share-prepared-statements />
      </statement>
      

       

      just may be not working correctly...

       

      I'd be grateful for any suggestions or experiences...

       

      Cheers

        Markus