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
- CLONE -Mapping DTD has changed from 3.0. A 3.1 version should be released and made availableHHH-2718Resolved issue: HHH-2718Diego Plentz
- Hibernate Serializable classes do not declare serialVersionUIDHHH-2586Resolved issue: HHH-2586
- CLONE -merge() with one-to-one throws ClassCastExceptionHHH-2000Resolved issue: HHH-2000Diego Plentz
- Unique Key or Primary Key violation on Insert/UpdateHHH-1721Resolved issue: HHH-1721
- subsequent calls to non-existent proxy causes NPEHHH-1695Resolved issue: HHH-1695Steve Ebersole
- org.hibernate.cfg.Configuration should obey standard java.util.Properties overwrite rulesHHH-1676Resolved issue: HHH-1676
- 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
- classcastexception when using dom4jsession to save xml of a versioned classHHH-1265Resolved issue: HHH-1265
- Extends Criteria API to support collection of <elements>HHH-1232Resolved issue: HHH-1232
- List-index defenition needs to be updatedHHH-1176Resolved issue: HHH-1176
- Discriminator based inheritance for embeddable typesHHH-1152Resolved issue: HHH-1152Marco Belladelli
- Column alias clashes under certain circumstancesHHH-1128Resolved issue: HHH-1128Emmanuel Bernard
- Problem in Oracle9Dialect when using inner query in from clauseHHH-1104Resolved issue: HHH-1104
- finalize method filter for proxiesHHH-1103Resolved issue: HHH-1103GavinG
- getLowercaseFunction for Firebird dialectHHH-1026Resolved issue: HHH-1026
- enrich PropertyNotFoundException and use it moreHHH-1024Resolved issue: HHH-1024
- not all dialects listed in org.hibernate.cfg.SettingsFactoryHHH-1023Resolved issue: HHH-1023
- Duplicate insert in join table when calling session.flush() twiceHHH-1018Resolved issue: HHH-1018Diego Plentz
- Mapping Jar not closed after readHHH-1017Resolved issue: HHH-1017
- Incorrect SQL generated when one-to-many foreign key is in a discriminated subclass tableHHH-1015Resolved issue: HHH-1015
- SchemaValidator mapping of double to SQL-Type DECIMAL with Precision and ScaleHHH-1008Resolved issue: HHH-1008Diego Plentz
- Oracle 9 Dialect uses deprecated typesHHH-1007Resolved issue: HHH-1007Steve Ebersole
- merge() with one-to-one throws ClassCastExceptionHHH-1004Resolved issue: HHH-1004
- explicit mapped-by in hbm.xmlHHH-1001Resolved issue: HHH-1001Emmanuel Bernard
- Portable escape sequence in like style stringsHHH-998Resolved issue: HHH-998
- FetchMode.JOIN in Criteria not working as expectedHHH-997Resolved issue: HHH-997
- Support order by associated entity column in many to manyHHH-996Resolved issue: HHH-996
- Order.ignoreCase() only works for VARCHAR types, not CHAR typesHHH-995Resolved issue: HHH-995Brett Meyer
- Sybase/SQLServer support for temporary tablesHHH-994Resolved issue: HHH-994Steve Ebersole
- Named Native-SQL query renders parameters wrong with setParameterList(...)HHH-990Resolved issue: HHH-990
- Need to check Thread.currentThread().getContextClassLoader() in ConfigHelperHHH-986Resolved issue: HHH-986GavinG
- FetchMode.SELECT javadoc wrongHHH-980Resolved issue: HHH-980
- Hibernate3 + HSQLDB 1.8.0.2 SchemaExport brokenHHH-973Resolved issue: HHH-973
- merge() succeeds even when another TX has deleted entityHHH-972Resolved issue: HHH-972
- Error reporting should be improved and suggestion for "lax error checking" with no exceptions thrownHHH-970Resolved issue: HHH-970
- ForeignGenerator and StatelessSessionHHH-968Resolved issue: HHH-968
- executeUpdate on StatelessSessionHHH-967Resolved issue: HHH-967Steve Ebersole
- buildSessionFactory failedHHH-966Resolved issue: HHH-966
- ORA-00936 with joined subclass / OracleHHH-964Resolved issue: HHH-964Steve Ebersole
- Incorectly bound parameters in HQLHHH-960Resolved issue: HHH-960
- Add an optional "where" parameter to org.hibernate.id.TableGeneratorHHH-959
- MSSQL: Distinct queries require all ORDER BY attributes to be selected.HHH-956Resolved issue: HHH-956
- SQL translation cut out second SELECT inside INHHH-955Resolved issue: HHH-955
50 of 77
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.