Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Transaction Context and Persistance context

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Team, as my knowledge in ejb persistence, if i am using transaction scoped persistence context, the persistence context is propagated to other ejb calls also under same transaction. For example, If I have called EJB2 from EJB1(under transaction1) the same transaction and persistence context is propagated to EJB2 and if any change is made to the managed entity inside EJB2, it will be reflected to the database after transaction completion.

But in the mentioned code, I have to do EntityManager.merge on managed entity "studBean". Kindly help me to clarify my understanding.

I am calling "StudProcessorBean " bean inside "CalculatorBean" through injection. As per my understanding, the "modifyName()" method should not use merge. But without this call, Student bean is not synchronised with the data base. Kindly help me.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic