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

Persistence Context propagation doubt

 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec says that when a persistent context is propagated, it needs an active JTA transaction. After propagation, if an entity manager is called on the component which called it, if the PersistenceContext.TRANSACTION is mentioned, then a new transaction is started.

My question is, what happens to the propagated persistence context?? What was the point of propagating it when a new transaction was to start??
 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help......
 
Vinay Nath
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you please explain the question? I couldnt understand it...

frm watever I understood frm question:

if CMT is used and persistent context is transaction scoped then

1) if a call is made to another bean using CMT, context being TrANSACTION and the method has REQUIRES_NEW then the propagated persistent context will not be used.

2) if a call is made to another bean using CMT, context being TrANSACTION and the method has REQUIRED/MANDATORY then the propagated persistent context will be used as the transaction will be propagted along with persistent context to that method.

hope it helps...
 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, so this means that if a transaction is not propagated, then a persistent context currently used by it will also not be propagated?? Right??
 
Vinay Nath
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
absolutely right!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic