1 Reply Latest reply on Feb 3, 2004 8:20 AM by Eric Fesler

    null transaction after RollbackException

    Eric Fesler Newbie

      Hi,

      I'm using Jboss 2.4.10 together with MvcSoft.

      I have a service bean with a method incrementing a counter in the DB. Since this method is used quite often, I marked it with transaction level "Required New" to reduce the scope and the time of the transaction.

      Unfortunately, I still have some Optimistic rollback exception. To solve this, I wanted to implement a retry process if the transaction failed. In the calling service bean (the one calling the service with theRequired New transaction level), I tried to catch the exception and retry the method call. But it didn't work because the original transaction (the one of the calling service) seem to be lost.

      I looked a little further and discover that when I do transactionManager.getTransaction() in the calling service, this return me null when the increment transaction is rollbacked.

      When no problem occur in the increment transaction, transactionManager.getTransaction() returns the calling transaction as expected.

      Does anybody have an idea how I can implement this retry process?

      Thanks,

      --ERic