merge « Transaction « JPA Q&A





1. Bypassing DELETE_ORPHANS in a transaction when moving objects from one parent to another, hibernate    stackoverflow.com

I am using a combination of Spring 2.5.6 and Hibernate Annotations. I have three objects(tables or w/e) under consideration: Customer, Address, Order. Customer has the Cascade DELETE_ORPHANS property set for addresses. What ...

2. JPA transaction rollback retry and recovery: merging entity with auto-incremented @Version    stackoverflow.com

I'd like to recover after a failed transaction. Now, of course after any rollback, all entities become detached and the entity manager is closed. However, the UI still holds ...

3. Struts 2: hibernate optimistic locking - allows user to merge conflicting data    struts.1045723.n5.nabble.com

Currently for client/server side validation, struts is able to maintain the data and shows it to the user, with the error messages and preserved user input. I'm using Hibernate for persistence. The StaleObjectStateException is caught inside the filter that I use to set up the Hibernate session. How would I then be able to get the object that Hibernate tries to ...

6. Insert/Delete problem during commit after merge()    forum.hibernate.org

Author Message igorlub Post subject: Insert/Delete problem during commit after merge() Posted: Wed May 17, 2006 6:15 am Newbie Joined: Sat May 06, 2006 6:31 am Posts: 9 Hi, I have detached object graph that I try to merge. One of detached entities in this graph is removed and replaced with new entity (which is not presented in DB ...

8. Problem using merge with nested transactions    forum.hibernate.org

I have a fairly common environment of spring 1 and hibernate 3 and I am having a problem when attempting the following (psuedo code): 1. start outer transaction 2. x = session.get(Foo.class, id) 3. add an item i to a blank collection on x (the collection is already there, im just adding an item, as opposed to adding a whole new ...

9. Detached entities : concurrent merge issue    forum.hibernate.org

Newbie Joined: Fri May 11, 2007 10:54 am Posts: 7 Hello, I am working with the detached entities pattern, and I am facing a concurrent merge issue. I reproduced it with the small following example. A class 'A' has two children b1 and b2 : Code: public class A { private Long id; private Integer ...





10. merge and optimistic locking exceptions    forum.hibernate.org

After upgrading to hibernate 3 our company substituted the merge call for saveorupdateCopy (we called saveorupdateCopy whenever we were updating a record). The problem is that merge does not throw the optimistic locking exception. Substituting update for saveorupdatecopy has caused all sorts of problems with NonUniqueObjectExceptions even though I am calling evict on the object before calling update.

11. Merge causes second insert in same transaction    forum.hibernate.org

In one transaction I do the following: organizationDAO.create(organization); // create client use org_id for client_id Client client = new Client(organization.getOrgId()); client.setClientName(organization.getOrgName()); clientDAO.create(client); // create clients OrgType orgTypeClient = new OrgType(); orgTypeClient.setClientId(client.getClientId()); orgTypeDAO.create(orgTypeClient); // update organization with this orgType and client id organization.setOrgTypeId(orgTypeClient.getOrgTypeId()); organization.setClientId(client.getClientId()); organizationDAO.flush(); organizationDAO.clear(); organizationDAO.update(organization); This creates a second organization record instead of merging the first inserted record. I need ...