Flush « Insert « JPA Q&A





2. INSERT statements and flush() behavior    forum.hibernate.org

I have the following two parallel transactions TX1: begin TX1 insert(person(unique_id=1)) flush commit TX1 TX2: begin TX2 insert(person(unique_id=1)) flush commit TX2 I know that only one commit statement will succeed due to the unique constraint. My question is, is there any possibility that the flush() call will succeed and the commit() fails due to a constraint violation exception. I'm in read ...

3. UPDATE after INSERT on session flush    forum.hibernate.org

If we save a new transient object with session.persist(...) followed by a flush afterwards a single INSERT-statement is executed as expected. But if the object's properties are changed between the session.persist(...) and flush an INSERT followed by an UPDATE are executed on flushing the session. We expect that only a single INSERT would be necessary to persist the entity instead of ...

4. Insert and Update in same flush!    forum.hibernate.org

Author Message TealWren Post subject: Insert and Update in same flush! Posted: Thu Feb 19, 2004 12:21 pm Regular Joined: Tue Sep 09, 2003 9:37 pm Posts: 54 Location: Ogden, Utah, USA I'm using Hibernate 2.1.2, with DB2. I'm flushing a complex object graph, consisting entirely of new objects. It does all of the inserts, but then does several ...

5. Insert and Update in same flush    forum.hibernate.org

Apparently, if I 'save' a new object, change the data, and then flush it generates an insert with the initial values from the 'save' and then an update with the current data. Is there a good reason for this behavior? We made the change below to sessionimpl, which effectively replaces an insert with the new data rather than doing both an ...

6. IDENTITY_INSERT must be on in SQLServer -cannot flush    forum.hibernate.org

Using the Increment Generator I can save an obejct with an int key with SQLServer - However when I flush I get the following errorjava.sql.SQLException: Cannot insert explicit value for identity column in table 'Products' when IDENTITY_INSERT is set to OFF I thnk that the DB is supposed to generate an ID but how do I declare to use this capability. ...

8. Flushing fails as if inserts were not executed    forum.hibernate.org

Newbie Joined: Wed Oct 26, 2005 11:28 am Posts: 1 I've tried to use Hibernate with BEA Weblogic server 8.1.3. I have an object (Customer), which has one-to-many related children (Addresses). Children have many-to-one relation to their parent. First I create a parent and attach to it a child - I put it into List (I also specified the parent from ...