aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes CDI event originator's transaction waits for Observer(AFTER_SUCCESS) transaction? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "CDI event originator Watch "CDI event originator New topic
Author

CDI event originator's transaction waits for Observer(AFTER_SUCCESS) transaction?

Agoston Bejo
Greenhorn

Joined: Nov 23, 2007
Posts: 8
Hi!

I have the following scenario: (pesudo-code)





==> the following happens:

[1] is only reached AFTER the transaction in SessionBean2.method2() finishes! (Although the last statement in SessionBean1.method1() is reached way before that.)

It's as if SessionBean1.method1()'s transaction somehow isn't "released" (for want of a better word -- it does get committed immediately, before the event handler ObserverObject.method2() is called!) until the *asynchronously called* Session2.method2()'s transaction finishes as well.

Does anyone know how I could avoid that?


(The point of the whole setup would be to have the long-running SessionBean2.method2() run in the background after T1's completion and have SessionBean1.method1() return as soon as possible.)


P.S.: I have verified that
a) T1 is committed immediately (the records go in the DB)
b) SessionBean2.method2() is called asynchronously (control jumps to the next statement in the calling code immediately)
c) the SessionBean1.method1() doesn't return control to the caller code until T2 finishes



Thanks,
Agoston
 
Don't get me started about those stupid light bulbs.
 
subject: CDI event originator's transaction waits for Observer(AFTER_SUCCESS) transaction?
 
Similar Threads
auto commit within JTS transaction
Puzzling Transactions.....
Enthuware question doubt
Question on MDB
EJB3 transction management Requires_new attribute