Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315067 - [Hibernate] Store version in a non-version property, disable/remove Hibernate optimistic locking
Summary: [Hibernate] Store version in a non-version property, disable/remove Hibernate...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-31 08:25 EDT by Martin Taal CLA
Modified: 2019-11-08 03:15 EST (History)
0 users

See Also:
stepper: review+


Attachments
Hibernate Store Patch (34.32 KB, patch)
2010-05-31 09:37 EDT, Martin Taal CLA
no flags Details | Diff
Small patch for cdo testcases (2.77 KB, patch)
2010-05-31 09:38 EDT, Martin Taal CLA
no flags Details | Diff
Combined patch v2 - ready to be committed (34.34 KB, patch)
2010-05-31 11:28 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Taal CLA 2010-05-31 08:25:34 EDT
The CDO Hibernate Store makes use of Hibernate optimistic locking. For this the version number passed in by CDO to the storage layer is used. Hibernate updates the version when updating information in the database. 
For fault free operation it is critical that the hibernate generated version number is the same as the one passed in by CDO. 

It shows that the mechanism of keeping the hibernate version number in sync with CDO's version number is not fault proof and that there are special cases where the version number in Hibernate is not increated while CDO expects an increase in version number.

This bugzilla proposes to store the CDO version as a normal property in the database. This means that Hibernate optimistic locking is disabled. 

The impact of this is considered to be minimal as:
- version checking is already done in the CDO layer, so having this in Hibernate is less needed and only results in extra overhead.
- for backward compatibility the version colum name is used.
Comment 1 Martin Taal CLA 2010-05-31 09:37:45 EDT
Created attachment 170524 [details]
Hibernate Store Patch
Comment 2 Martin Taal CLA 2010-05-31 09:38:35 EDT
Created attachment 170525 [details]
Small patch for cdo testcases

This patch contains some small enhancements for enabling the testcases for Hibernate
Comment 3 Martin Taal CLA 2010-05-31 09:40:08 EDT
The CDO Hibernate store patch also contains fixes for the following 2 issues:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=301339
[Hibernate] Write Default Value from Client to Server
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=313539
[Hibernate] NonUniqueObjectException when saving a model with cyclical references
Comment 4 Eike Stepper CLA 2010-05-31 11:28:29 EDT
Created attachment 170541 [details]
Combined patch v2 - ready to be committed

Just a few reformats ;-)
Comment 5 Martin Taal CLA 2010-05-31 12:42:46 EDT
Patch committed
Comment 6 Eike Stepper CLA 2010-06-29 04:35:36 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/