• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

T1 is container managed transaction or bean managed transaction?

 
Bartender
Posts: 2162
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
On session 13.6.1 Bean Managed Transaction Demarcation of JSR 318 specification, on p.367,


if the client request is associated with a transaction T1 and the instance is not associated with a transaction, the container suspends the client's transaction association and invokes the method with an unspecified transaction context.


and


If the client is associated with a transaction T1, and the instance is already associated with a transaction T2, the container suspends the client's transaction association and invokes the method with the transaction context that is associated with the instance T2.



My question is what type of transaction management of T1 ? Is T1 container managed transaction or bean managed transaction?
For sure, T2 is a bean managed transaction.

(I guess T1 is container managed. According to Head First EJB 2.0, a bean managed transaction won't allow other transactions associations.
I guess if T1 is a bean managed transaction, T1 won't allow T2 to associate with T1. )
 
Creator of Enthuware JWS+ V6
Posts: 3398
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My question is what type of transaction management of T1 ? Is T1 container managed transaction or bean managed transaction?


That is not relevant here: any transaction currently associated with the client will be suspended.
 
Himai Minh
Bartender
Posts: 2162
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
So, T1 can be a container or bean managed transaction. But T2 , in this case is a bean managed transaction.
I found an article online , it says a bean managed transaction (T2 in this case) does not join another transaction (T1 in this case) and the container will suspend T1 until T2 is completed.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3398
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But T2 , in this case is a bean managed transaction.


Yes. In other words a client transaction is always suspended when it calls a Bean-managed EJB (even if the client is another Bean Managed EJB).

The transaction currently associated with the instance (T2) is only possible for a Stateful SB.
 
There is no "i" in denial. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic