Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Persistence Context propagation doubt

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please help......
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
absolutely right!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic