3 Replies Latest reply on Dec 6, 2003 5:39 PM by dmassie

    Unable to commit with JBoss 3.2.2 or 3.2.3RC1

    dmassie

      I have a 1:N CMR between Category and Auction CMP EJBs, with the relationships defined as follows:

      In CategoryEJB
      <>
      /**
      *
      * @ejb.relation
      * name="category-auctions"
      * role-name="category-has-auctions"
      *@ejb.value-object
      * compose="org.jbay.domain.catalogue.model.AuctionValue"
      * compose-name="AuctionValue"
      * members="org.jbay.domain.catalogue.interfaces.AuctionLocal"
      * members-name="AuctionValue"
      * relation="external"
      * type="java.util.Collection"
      */
      public abstract Collection getAuctions( );

      /**
      * @ejb.transaction
      * type="Required"
      */
      public abstract void setAuctions( Collection param );

      In AuctionEJB:
      <>
      /**
      * @ejb.interface-method
      * @ejb.relation
      * name="category-auctions"
      * role-name="auction-belongs_to-category"
      * target-ejb="Category"
      * cascade-delete="yes"
      *
      * @jboss.relation
      * fk-column="category_fk"
      * related-pk-field="categoryID"
      * fk-contraint="${db.foreign.key}"
      */
      public abstract CategoryLocal getCategory( );

      /**
      * @ejb.interface-method
      * @ejb.transaction
      * type="Required"
      */
      public abstract void setCategory( CategoryLocal category );

      /**
      * @ejb.create-method
      */
      public String ejbCreate(AuctionValue value)
      throws CreateException
      {
      setAuctionID(AuctionUtil.generateGUID(this));
      setAuctionValue(value);
      return null;
      }

      I have a stateless session EJB with the following method to add an AuctionValue (Value object) to a category:

      /**
      * Creates a new auction
      * @param auctionValue The values for the new auction
      *
      * @ejb.interface-method
      * @ejb.transaction
      * type="Required"
      */
      public void addAuction(AuctionValue auctionValue,String categoryID,String seller) {
      CategoryLocal categoryLocal = null;
      try{
      categoryLocal = getCategoryHome().findByPrimaryKey(categoryID);
      CategoryValue category = categoryLocal.getCategoryValue();
      category.addAuctionValue(auctionValue);
      categoryLocal.setCategoryValue(category);
      }
      catch(FinderException fe)
      {
      throw new EJBException("Parent category could not be located");
      }
      }

      When this method is called the following error is produced:
      2003-12-04 23:44:30,421 ERROR [STDERR] java.sql.SQLException: General error: Warning: Some non-transactional changed tables couldn't be rolled back
      2003-12-04 23:44:30,421 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at com.mysql.jdbc.Connection.execSQL(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at com.mysql.jdbc.Connection.execSQL(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at com.mysql.jdbc.Connection.rollback(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.rollback(LocalManagedConnection.java:118)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.rollback(TxConnectionManager.java:832)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1664)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:403)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:398)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:277)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:700)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
      2003-12-04 23:44:30,421 ERROR [STDERR] at $Proxy53.addAuction(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.jbay.services.catalogue.test.CatalogueTest.testAddAuction(Unknown Source)
      2003-12-04 23:44:30,421 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2003-12-04 23:44:30,421 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2003-12-04 23:44:30,421 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2003-12-04 23:44:30,421 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestCase.runTest(TestCase.java:154)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestCase.runBare(TestCase.java:127)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestResult$1.protect(TestResult.java:106)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestResult.runProtected(TestResult.java:124)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestResult.run(TestResult.java:109)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestCase.run(TestCase.java:118)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestSuite.runTest(TestSuite.java:208)
      2003-12-04 23:44:30,421 ERROR [STDERR] at junit.framework.TestSuite.run(TestSuite.java:203)
      2003-12-04 23:44:30,421 ERROR [STDERR] at org.junitee.runner.TestRunner$1.run(TestRunner.java:72)
      2003-12-04 23:44:30,421 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)
      2003-12-04 23:44:30,437 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void org.jbay.services.catalogue.CatalogueLocal.addAuction(org.jbay.domain.catalogue.model.AuctionValue,java.lang.String,java.lang.String), causedBy:
      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=daniel//55, BranchQual=] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0id=43a0d4c6c0a80101015872f5c32f66da)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:413)
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:398)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:277)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:375)
      at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
      at $Proxy53.addAuction(Unknown Source)
      at org.jbay.services.catalogue.test.CatalogueTest.testAddAuction(Unknown Source)
      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:324)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.junitee.runner.TestRunner$1.run(TestRunner.java:72)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0id=43a0d4c6c0a80101015872f5c32f66da
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:155)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:627)
      at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:421)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
      at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:714)
      at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:149)
      at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
      at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1308)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:347)
      ... 26 more
      2003-12-04 23:44:30,593 ERROR [org.jboss.web.localhost.Engine] CoyoteAdapter Bad Cookie Name: Path /Value: /jbay-test
      java.lang.IllegalArgumentException: Cookie name Path is a reserved token
      at javax.servlet.http.Cookie.(Cookie.java:185)
      at org.apache.coyote.tomcat4.CoyoteAdapter.parseCookies(CoyoteAdapter.java:393)
      at org.apache.coyote.tomcat4.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:295)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:191)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
      at java.lang.Thread.run(Thread.java:534)


      Any ideas why?
      Thanks
      Daniel