[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7151) Like the query-API, also NaturalIdLoadAccess should provide method setFlushMode(FlushMode mode)

Guenther Demetz (JIRA) noreply at atlassian.com
Tue Mar 6 10:12:48 EST 2012


Like the query-API, also NaturalIdLoadAccess should provide method setFlushMode(FlushMode mode)
-----------------------------------------------------------------------------------------------

                 Key: HHH-7151
                 URL: https://hibernate.onjira.com/browse/HHH-7151
             Project: Hibernate ORM
          Issue Type: Improvement
          Components: core
    Affects Versions: 4.1.1
         Environment: -
            Reporter: Guenther Demetz


Implicit flushes in my opinion always should be, as widest as possible, under users control, this because
unneccessary flushings often create serious implications, especially when working with long-time transactions.
On long-time transactions the time-window between flush and final commit become big enough
to cause lock-waits or/and lock-timeouts on concurrent transactions.
With bugfix HHH-7094 the NaturalIdLoadAccess becomes pratically ununseable for our projects.

Like on all Hibernate Query-Apis, the user should have the possibility to choose between variuos FlushModes.
Example:

(Simple)NaturalIdLoadAccess naturalIdAccess = session.by(Simple)NaturalId(MyEntity.class);
naturalIdAccess.setFlushMode(FlushMode.AUTO); // flush if required
naturalIdAccess.setFlushMode(FlushMode.COMMIT); // don't flush until commit time
Object obj = naturalIdAccess.load(id);

N.B.: I enabled the 'Requires Release Note' check-box, because this enhancement implies a behaviour change.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list