1 Reply Latest reply on Sep 21, 2005 10:24 AM by Alejandro Bernal

    org.jboss.tm.JBossRollbackException: Unable to commit

    Alejandro Bernal Newbie

      Hello: Im trying to delete a single record from the database using the entity Manager remove() method.

      Using an Stateless Session bean with the Entity Manager em

      public void eliminarPermiso(Integer idPermiso) {
      
      Permisosadmins permiso = (Permisosadmins)em.find(Permisosadmins.class, idPermiso);
      em.remove(permiso);
      }


      when I try to use that method I get the following error:

      java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=athlon/67, BranchQual=, localId=67] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.ObjectDeletedException: deleted entity passed to persist: [com.corgil.db.Permisosadmins#<null>])
       at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:185)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:167)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:74)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:195)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
       at $Proxy145.eliminarPermiso(Unknown Source)
       at org.apache.jsp.lstAdministradores_jsp._jspService(org.apache.jsp.lstAdministradores_jsp:117)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=athlon/67, BranchQual=, localId=67] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.ObjectDeletedException: deleted entity passed to persist: [com.corgil.db.Permisosadmins#<null>])
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:354)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
       ... 43 more


      My current configuration is Jboss 4.0.3 RC2 and Postgress 7.4 database.

      I don't know if it it can be a database configuration problem, because all samples that I have found on Internet show that remove() should be used that way.

      I'll appreciate any help, thanks
      Alejandro