-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: JPA Merge operation and Version field
PostPosted: Wed Jun 22, 2011 4:28 pm 
Newbie

Joined: Wed Jun 22, 2011 4:19 pm
Posts: 1
I have a entity in the database that contains a version field. This is a web application so the object becomes detached. When the update is made later I am using entityManager.merge(entity).

I noticed in the SQL generated it always does a select and then an update. Furthermore, it is the select that may throw the optimistic lock exception. I know this because if I manually update the version number field, I just see the select.

Can I configured it to bypass the select and have it just attempt the update? After all, seems that is the purpose of the version field and the update can throw the optimistic lock exception as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.