Can RequiresNew EJB methods be called within a timeout/rolled-back transaction?
1 posts in topic
Flat View  Flat View

Posted By:   Alex_McManus
Posted On:   Wednesday, September 5, 2001 03:08 AM

I have some error handling code that calls a EJB method with a RequiresNew transaction setting. This method call fails when called from within an existing transaction that timed-out or was marked for rollback due to the error.

Is this behaviour correct? Given that the EJB method should create its own transaction, I would expect the method call to work, irrespective of the state of the containing transaction, but I'm having trouble convincing Bea (re Weblogic 6.0). Is this a gray area in the EJB Spec? How do other AppServers behave?

Re: Can RequiresNew EJB methods be called within a timeout/rolled-back transaction?

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, September 6, 2001 04:48 AM

keep in mind that RequiresNew needs to suspend current transaction before starting its own for the duration of the method. therefore, what I am guessing is happening is that weblogic's implementation cannot suspend a transaction that has timed-out or has been explicitly set for rollback. whether this implementation is a valid one is questionnable but specifications are not clear on this issue and therefore weblogic probably decided to go with simpler solution of not allowing this behavior. the j2ee blueprints indicate that RequiresNew is particularly useful for logging so that even if the transaction fails, it is being logged as executed (if desired) and therefore I would think that weblogic's decision on this issue is a falacy and should be fixed in the next release, at least for the situation in which transaction is marked for rollback only. a timed-out transaction is a really gray area and I am sure that there are a lot of issues with it that I cannot think of now.
About | Sitemap | Contact