[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2729) Inserts get done even when flushmode == manual and they are not necessary

Frits Jalvingh (JIRA) noreply at atlassian.com
Mon Jul 16 08:58:52 EDT 2007


Inserts get done even when flushmode == manual and they are not necessary
-------------------------------------------------------------------------

                 Key: HHH-2729
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2729
             Project: Hibernate3
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.3
         Environment: Hibernate 3.2.3, HBEM 3.3.1, Tomcat 6.0.10, PostgresSQL 8.2, Seam 2.0.0B1
            Reporter: Frits Jalvingh
         Attachments: hib.patch

(See also http://jboss.com/index.html?module=bb&op=viewtopic&p=4064502#4064502)

When the flushmode is manual (and in many other cases too) Hibernate should not do an insert when persist() gets called. The current code always forces an insert when a record is persist()ed with generated keys, even if the generator can be used without the insert. This causes trouble when an insert is used in seam's long running conversations (and when an entity is persisted while not all of it's fields have valid data - nullity etc).

The problem is caused by a few problems in passing around a boolean requiresImmediateIdAccess) which gets set to true always in some calls. A fix which prevents Hibernate from doing the insert is attached.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list