0 Replies Latest reply on Feb 3, 2004 11:06 AM by timjonesh

    javax.ejb.EJBException: Update failed. Expected one affected

    timjonesh Newbie

      Hi,

      I am currently trying to use JBoss with an Oracle (8.x) Datasource. I am getting the exception listed below.

      Basically what we are doing is creating a CMP entity bean from a stateless session bean and then trying to set some additional values on it.

      The method on the SS bean has bean declared as <trans-attribute>Required</trans-attribute> and so have all the methods on the entity bean.

      The call to the home.create() method works fine but as soon as one of the setXXX() methods on the entity bean is called the exception below is thrown.

      The exact same code runs fine using the default Hypersonic datasouce that ships with JBoss.

      Should I be using the Oracle XA datasource? This seems like it may be a configuration problem.

      Thanks for your help!!

      Tim

      12:40:54,214 ERROR [LogInterceptor] TransactionRolledbackException in method: pu
      blic abstract void com.wfsc.pki.cms.common.dataaccess.interfaces.DataAccess.inse
      rtData(java.util.List) throws java.rmi.RemoteException, causedBy:
      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImp
      l [FormatId=257, GlobalId=pkidev21//69, BranchQual=] status=STATUS_NO_TRANSACTIO
      N; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affe
      cted row: rowsAffected=0id=1)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:409)
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
      T.java:398)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:277)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      28)
      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(ProxyFacto
      ryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessi
      onContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      367)
      at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
      60)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      .java:701)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: row
      sAffected=0id=1
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCSto
      reEntityCommand.java:192)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStore
      Manager.java:592)
      at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenc
      eManager.java:421)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.stor
      eEntity(CachedConnectionInterceptor.java:387)
      at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:713)
      at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap
      .java:149)
      at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCo
      mpletion(GlobalTxEntityMap.java:215)
      at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:
      1304)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:343)
      ... 25 more