1 Reply Latest reply on Oct 18, 2001 9:18 PM by nuanda

    UserTransaction.commit failure in ejbStore

    darrene

      Hi Folks,

      I have following config:
      3 BMP entity beans deployed on 1 JBoss server (v2.4.0)
      All have transaction attribute set to 'Required'

      Client code (java application, running on separate server) does the following:
      1)Lookup for UserTransaction on JBoss server.
      2)UT.begin
      3)various operations on combination of the beans
      4)UT.commit

      At point of commit the following exception occurs in client:
      javax.transaction.RollbackException: Unable to commit, tx=XidImpl [FormatId=257, GlobalId=t20//32, BranchQual=] status=STATUS_ROLLEDBACK

      JBoss console shows the error:
      [EntitySynchronizationInterceptor] Store failed

      At this point the ejbStore method was performing a SQL 'UPDATE TABLENAME SET....etc' which returns 0, indicating that zero rows were updated by the statement (but the rows have been created, during the transaction using ejbCreate).

      ejbStore works normally outside of transactions, always indicating that 1 row has been updated.


      Can anyone point me in the direction I should be looking, to determine what is happening to cause this failure?


      Many Thanks,
      Darren

        • 1. Re: UserTransaction.commit failure in ejbStore
          nuanda

          I don't believe that client initiated UserTransactions are working with JBoss Darren. I've been following this subject for a while now and noone seems to be able to get it to work (although I have only seen it in the context of an Oracle backend).

          My personal uninformed theory is that the ejbStore() container callback is operating in a different transaction context to the rest of the ops, hence when it 'UPDATES WHERE X', X does not yet exist in it's context and blam, operation fails.

          Some folks are likely to post and tell you not to use Client side transactions and that type of work is for session beans. However I always wanted to use them for my JUnit tests...so that I could be sure no junk data was left in the database after each test run (by intentially rolling back).

          Anyway, anybody else who knows different please enlighten us re: client side UserTransactions w/ JBoss !

          Dave