The transaction seems to hang in Jonas 2.0, if I rollback an empty
transaction. If I run a client program that rolls back an empty transaction
(e.g. the first operation inside the transaction throws an exception), the
subsequent runs wait until the JTM timeout occurs in EJBServer.

The problem does not occur if at least one operation on entity bean inside
the transaction is performed correctly (the operation does not throw an
exception).

Example code that hangs:

-- CUT --

UserTransaction utx = ...
MyEJBean1 b1 = ... // Entity bean
MyEJBean2 b2 = ... // Entity bean

try
{
  utx.begin();
  b1.substract(100); // the operation throws an exception
  b2.add(100);
  utx.commit();
}
catch(Exception e)
{
  try
  {
    utx.rollback();
  }
  catch(Exception e)
  {
  }
}

--- CUT ---

The code works if I reorder the operations on b1 and b2:

-- CUT --

  b2.add(100);
  b1.substract(100); // the operation throws an exception

-- CUT --

This is an annoying feature/bug because it locks the associated beans until
the transaction times out. Thus, no operations on the beans cannot be
performed for a long time.

- Joonas Haapsaari

----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to