Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

T1 is container managed transaction or bean managed transaction?

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • 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. )
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic