This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes JPA 2.0 em.merge() firing select statements only (no update) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA 2.0 em.merge() firing select statements only (no update)" Watch "JPA 2.0 em.merge() firing select statements only (no update)" New topic
Author

JPA 2.0 em.merge() firing select statements only (no update)

Juggy Obhi
Ranch Hand

Joined: Jul 02, 2007
Posts: 51
Hi,

I need help to understand what exactly is wrong with my logic as per JPA2.0 (Hibernate 3.5).




My problem is that i see em.merge() firing only select statements. I could not see any update statements. I know i am doing some basics wrong but i have not been able to get it. Please guide.



Regards,
Jagpreet Singh


It does not matter how many times you fall,what matters is how many times you stand back.
Juggy Obhi
Ranch Hand

Joined: Jul 02, 2007
Posts: 51
It took me almost a day to found this -

In proxy mode (which is the default), only 'external' method calls coming in through the proxy will be intercepted. This means that 'self-invocation', i.e. a method within the target object calling some other method of the target object, won't lead to an actual transaction at runtime even if the invoked method is marked with @Transactional!


I hope this will same time for some one.


Regards,
Jagpreet Singh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA 2.0 em.merge() firing select statements only (no update)
 
Similar Threads
EntityManager
How do you update a collection if some exist and some are new?
No SQL result unless i reopen
How to update an entity when the persistence context is extended?
Entity Objec previous state