• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between transaction and extended persistence context

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I am very confused about difference between beanmanaged and container managed transactions.

How the persistense context relate with bean managed and container managed transactions?

what is the difference between transaction and extended persistence context?

how these two relate with container and bean managed transaction?

Please help in this.I am confused with all these terms.


Please help me.


Thanks
Bhaskar
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The bean managed transaction(a.k.a. BMT) let you do the transaction yourself, like, defining the demarcation of the transaction, when to commit and when to set rollback etc. The container managed tranaction let the container do the lifting.

Usual case of using persistence service provided by the container is let the container decide when to persist entities related. When the method returned, the tranaction ended also. Hence, the states of entities persisted to the db. In this case the beginning and end of the method defines the persistence scope. If you're using stateful session bean, client might go through many different methods which may need the data from method to method. Therefore, the demarcation limited to the method might not be applied. The extended scope for peresistence context can keep the entity manger from being destroied when the client goes through the methods, hence, for the following case:

Usual Persistence Context:


Exteneded Persistence Context:


I hope it helps.
 
bhaskaritp naidu
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Thanks a lot. your explanation is good

Thanks
Bhaskar
reply
    Bookmark Topic Watch Topic
  • New Topic