Joonas Haapsaari wrote:
> 
> 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
> 
Hi Joonas,
I think we need more details about your problem because I cannot
reproduce it
here is the test I made:
b1 is an entitybean BMP
b2 is an entitybean CMP

try {
  utx.begin();
  b1.doAppException_1();      // throw an application Exception
  int num = b2.getNumber();
  utx.commit();
  Test.testFAIL("Test 1 ");
  }catch (Exception e) {
  try {
     utx.rollback();
  }catch (Exception ex) {
    System.out.println(ex);
    Test.testFAIL("Test 1: "+ex);
    }
  }
 Test.testPASS("Test 1");
 }

This test pass without problem. It is the same if the business method
called on b1 throws an UncheckedException or RemoteException or
EJBException.
What is the difference with your try?
Best regards,


-- 
        Philippe

Philippe Coq  BullSoft  Phone: (33) 04 76 29 78 49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]  http://www-frec.bull.com
Download our EJBServer at http://www.bullsoft.com/ejb
----
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