Skip to content

hgcummings/hibernate-concurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduces a flush entity event listener that checks whether the version of the entity is out-of-date. This is specifically checking for the case when the version has been updated from application code.

Rationale

This is a very common use case for supporting optimistic concurrency in web applications/services, which typically have minimal server-side state and would not keep a Hibernate session open from one request to the next. The Hibernate documentation does not appeasr to cover this case specifically.

Implementation

This class allows the original version passed out in one response to be used for an optimistic concurrency check in a subsequent request. For example, the version may be rendered out to an HTML form as a hidden field, and bound back to the persisted entity when the form is POSTed.

Target Version

Master is currently tracking the latest Hibernate 4 release. See branches for earlier versions (including Hibernate 3).

About

Change for supporting optimistic concurrency in stateless applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages