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

em.merge Persistence Issue

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

I have a fairly standard code like this.

And in Action Class, I have two methods each of which corresponds to two buttons in the page.

1) I am saving a child by clicking a button and thus invoking saveChild(). -----I have observed that changes are saved in database.

2) I am saving Parent by clicking another button and thus invoking updateParent(). -----I have observed that the previously persisted changes are still in database

3) Now when I try to save another child by invoking saveChild(), the previously saved changes are overwritten resulting in newly saved changes only.

When I try to inspect the Parent object before it is sent for em.merge in Step(3), it still has all the proper data (I mean I can see both saved childs).

If I try the above steps in the order (1),(3),(2) everything is absolutely fine. Please help me understand this issue.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic