[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3317) Entities saved within onPreUpdate() never inserted into db when id generator is sequenze (f.e. oracle)

Martin Backhaus (JIRA) noreply at atlassian.com
Fri May 30 07:55:33 EDT 2008


Entities saved within onPreUpdate() never inserted into db when id generator is sequenze (f.e. oracle)
------------------------------------------------------------------------------------------------------

                 Key: HHH-3317
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3317
             Project: Hibernate3
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.6
         Environment: hibernate3.2.6.ga.jar, Oracle 10
            Reporter: Martin Backhaus
            Priority: Minor


If you save (insert) a entity within the event preUpdate and the id is a oracle-sequenze, hibernate put the entity to insert in the session-ActionQueue, BUT NEVER INSERTS  it. If you use mysql/hsql... where the id is differently generated, the insert happens immediately and no put to the ActionQueue occures.

As workaround you can queue the object (to insert) yourself and call save() within the postUpdate-Event.

I use this events for historizing some stuff.

Inserts within onDelete() works fine.

the ids are annotated as shown here:
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
protected Long id = null;


-- 
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