• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

EM and Persistence Contexts

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Does Each EntityManager have only one PersistenceContext , and does that requires only transaction per PersistenceContext !???

Thanks
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes there is only one persistence context in an EntityManager or Session object. it is a has a relationship.

Mark
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..and as long as the entity managers come from the same factory, the persistence context is the same..?
 
author
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Antero Laukkanen:
..and as long as the entity managers come from the same factory, the persistence context is the same..?


They will only be the same if the entity managers are both container-managed and were obtained in the same transaction.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic