Issues
- Hibernate increases version on readHHH-5867Resolved issue: HHH-5867Strong Liu
- Add setReadOnly(true) method to the Criteria interfaceHHH-3578Resolved issue: HHH-3578Former user
- Would like HQL support in criteria.OrderHHH-2987Resolved issue: HHH-2987
- Native SQLQuey combined with addEntity forces to retrieve all columnsHHH-2974Resolved issue: HHH-2974
- Incomplete/non-informative javadocs for events systemHHH-2958Resolved issue: HHH-2958Diego Plentz
- Hibernate Serializable classes do not declare serialVersionUIDHHH-2586Resolved issue: HHH-2586
- add alias when create a subcriteriaHHH-1991Resolved issue: HHH-1991Diego Plentz
- Sorting based on an optionally associated columnHHH-1821Resolved issue: HHH-1821
- validate not working with oracle dblinksHHH-1785Resolved issue: HHH-1785
- org.hibernate.cfg.Configuration should obey standard java.util.Properties overwrite rulesHHH-1676Resolved issue: HHH-1676
- Lift restriction on associations in QBEHHH-1628Resolved issue: HHH-1628
- Hibernate fails after 1500 sessions on client Java5 JVMHHH-1579Resolved issue: HHH-1579Diego Plentz
- big misdesign in org.hibernate.cfg.Configuration breaks delegation Model of java.util.PropertiesHHH-1510Resolved issue: HHH-1510
- any mapping with composite id-type does not workHHH-1481
- Interceptor currentState and previousState for collections in onFlushDirtyHHH-1456Resolved issue: HHH-1456
- many-to-many with additional 'with' join clause generates bad sqlHHH-1433Resolved issue: HHH-1433Steve Ebersole
- Unclosed ResultSet when using IdentityHHH-1312Resolved issue: HHH-1312Former user
- Added support for LVARCHAR in InformixDialectHHH-1215Resolved issue: HHH-1215Steve Ebersole
- problem with version value of persistent objectHHH-1188Resolved issue: HHH-1188
- List-index defenition needs to be updatedHHH-1176Resolved issue: HHH-1176
- Hibernate does not properly deal with empty strings in maps on OracleHHH-1173Resolved issue: HHH-1173
- Missing configuration templates for the new MimerSQLDialectHHH-1172Resolved issue: HHH-1172
- HiLoGenerator uses ints even if the id is a longHHH-1169Resolved issue: HHH-1169
- Problem combining locking and paging on OracleHHH-1168Resolved issue: HHH-1168Steve Ebersole
- Bidirectional many-to-one fails to write the sort column when the collection is a listHHH-1165Resolved issue: HHH-1165
- Documentation/manual model inconsistencyHHH-1164Resolved issue: HHH-1164
- CriteriaImpl setter for session property incorrectly takes SessionImplHHH-1159Resolved issue: HHH-1159
- Performance problem StatelessSession and StatefulPersistenceContext.clearHHH-1157Resolved issue: HHH-1157
- NPE flushing reattached entity w/ non-mutable natural-idHHH-1149Resolved issue: HHH-1149Steve Ebersole
- HQL query with a select count in where clause for a sub-class property doesn't with with ASTQueryTranslatorFactoryHHH-1147Resolved issue: HHH-1147Steve Ebersole
- getOldState() can be null (Tested with PreUpdateEventListener)HHH-1139Resolved issue: HHH-1139Steve Ebersole
- No ConstraintName when using PostgreSQLHHH-1138Resolved issue: HHH-1138Steve Ebersole
- Criteria.createAlias and outer joinHHH-1137Resolved issue: HHH-1137
- more meaningful AssertionFailure message in org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(...)HHH-1136Resolved issue: HHH-1136Max Rydahl Andersen
- Documentation: add Chapter quick links in the TOCHHH-1135Resolved issue: HHH-1135
- Comparators, defined for collections in mapping files, are not setHHH-1133Resolved issue: HHH-1133Steve Ebersole
- InformixDialect bug: in InformixDialect classHHH-1132Resolved issue: HHH-1132
- Column alias clashes under certain circumstancesHHH-1128Resolved issue: HHH-1128Emmanuel Bernard
- hibernate.default_schema ignored by SchemaUpdate (still)HHH-1126Resolved issue: HHH-1126
- Cannot put more than 1000 elements in a InExpressionHHH-1123Resolved issue: HHH-1123Steve Ebersole
- Fix build.sh for Hibernate3 (for linux compilation)HHH-1118Resolved issue: HHH-1118
- Incorrect org.hibernate.jdbc.ConnectionManager.isAggressiveRelease()HHH-1117Resolved issue: HHH-1117Steve Ebersole
- Problem in "one-to-zero-or-one" relationshipHHH-1115Resolved issue: HHH-1115
- The first (HSQL) Hibernate Application doesn't work as expected due to lack of database shutdownHHH-1114Resolved issue: HHH-1114Christian Bauer
- idbag composite-element cascade-on-save gives "could not bind value POST_INSERT_INDICATOR to" collection-idHHH-1113Resolved issue: HHH-1113
- mapping properties using same columns and pagination supportHHH-1110Resolved issue: HHH-1110
- HQL nested property reference without alias doesn't work if the property is *not* a componentHHH-1107Resolved issue: HHH-1107Joshua Davis
- Problem in Oracle9Dialect when using inner query in from clauseHHH-1104Resolved issue: HHH-1104
- finalize method filter for proxiesHHH-1103Resolved issue: HHH-1103GavinG
- associations join fetched in HQL without owner being selectedHHH-1101Resolved issue: HHH-1101Steve Ebersole
50 of 71
Hibernate increases version on read
Rejected
Description
Attachments
1
Details
Assignee
Strong LiuStrong LiuReporter
ChristianChristianComponents
Affects versions
Priority
Critical
Details
Details
Assignee
Strong Liu
Strong LiuReporter
Christian
ChristianComponents
Affects versions
Priority
Created January 25, 2011 at 8:43 AM
Updated March 7, 2014 at 5:31 PM
Resolved May 20, 2011 at 7:30 AM
Activity
Show:
Brett MeyerMarch 7, 2014 at 5:31 PM
Bulk closing rejected tickets in "resolved" state.
Strong LiuMay 20, 2011 at 7:30 AM
it is not a bug, this is caused by your own custom type impl.
hibernate use equals to check if a property is changed (aka dirty).
in your test, the MyComponent#type is null, and with your ShortEnumUserType#equals, it returns false if the type is null,
so, you actually tell hibernate if the type is null, then the managed entity is dirty, that's why hibernate schedule a update.
add
On a special constellation hibernate increases the internal used version of an entity on a read operation. For example if you save an entity the version is initial set. If you execute a query to read the entity afterwards, the version increases on this read. Please notice that the entity has NOT changed in the meantime. An update of the version must not happen here.
This problem seems to occur only if you have a few prequisites:
1. An entity, which has a component or subclasses
2. The component/subclasses must use an custom usertype
3. The read operation is covered by transaction
The bug leads to StaleObjectStateExceptions in production because the version has changed after a read operation by another thread.
An example is attached.