Issues
- Hibernate increases version on readHHH-5867Resolved issue: HHH-5867Strong Liu
- ClassCastException with parameter as CASE resultsHHH-4700Resolved issue: HHH-4700Steve Ebersole
- instance not of expected entity type: java.util.HashMap is not a com.domian.Order_audHHH-3903Resolved issue: HHH-3903Diego Plentz
- 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
- org.hibernate.criterion.Restrictions.in(?) should break up lists of 1000+ items, Oracle DialectHHH-2594Resolved issue: HHH-2594
- Hibernate Serializable classes do not declare serialVersionUIDHHH-2586Resolved issue: HHH-2586
- Filter and Join together BUG -attachments included for example of reproductionHHH-2530
- Filter and Join togetherHHH-2526Resolved issue: HHH-2526
- createQuery() converts JPQL into incorrect SQLHHH-2386Resolved issue: HHH-2386
- replicate() of non-versioned entiy can result in wrong value for version in entity cacheHHH-2378Resolved issue: HHH-2378Max Rydahl Andersen
- Many-to-one cascade fails with TransientObjectException if the inverse collection is marked CascadeType.DELETE_ORPHANHHH-2269Resolved issue: HHH-2269Former user
- Criteria query return repeated objects when quering for an object with Lazy one to many associationHHH-2179Resolved issue: HHH-2179
- problem with JavaAssistHHH-2141Resolved issue: HHH-2141
- Hibernate XML Mapping should not depend on dom4jHHH-2125Resolved issue: HHH-2125Yoann Rodière
- HibernateException hidden during flush using XA with WAS6HHH-2124Resolved issue: HHH-2124Chris Bredesen
- CLONE -explicit and implicit query with enabled filter gives different resultsHHH-2116Resolved issue: HHH-2116Diego Plentz
- Hibernate violates referential integrity of an underlying databaseHHH-2090Resolved issue: HHH-2090
- org.hibernate.event.def.DefaultLoadEventListener logs exception at info levelHHH-2085Resolved issue: HHH-2085
- Hibernate could not map number(1) to a boolean with direct field access mappingHHH-2084Resolved issue: HHH-2084
- StatelessSession and self referenced entity with joined subclassesHHH-2083Resolved issue: HHH-2083
- Providing an escape sequence for Criteria queriesHHH-2077Resolved issue: HHH-2077
- Batch updates doesn't work with custom NamingStrategyHHH-2069Resolved issue: HHH-2069
- Delete not always executingHHH-2064Resolved issue: HHH-2064
- Record User parameters directly int the Hibernate sessionHHH-2061Resolved issue: HHH-2061
- Section 19.2 of the documentation does not show Ehcache as supporting clusters. It does.HHH-2059Resolved issue: HHH-2059Diego Plentz
- Persistent wrapper collections should support genericsHHH-2054Resolved issue: HHH-2054
- explicit and implicit query with enabled filter gives different resultsHHH-2050Resolved issue: HHH-2050
- make Query and Criteria extend java.lang.IterableHHH-2047Resolved issue: HHH-2047
- There is an bug in InformixDialect preventing generator-class=native to work.HHH-2043Resolved issue: HHH-2043
- merge listener over-writes Interceptor changes to component state for a transient entityHHH-2027Resolved issue: HHH-2027Steve Ebersole
- performance optimization of JTATransactionFactory.isTransactionInProgress()HHH-2023Resolved issue: HHH-2023Steve Ebersole
- Pass 'format' parameter from SchemaExportTask (Ant) to SchemaExportHHH-2020
- Cannot map views in postgres unless hbm2ddl.auto is unsetHHH-2018Resolved issue: HHH-2018Diego Plentz
- Restrictions.sizeEq fails when collection is mapped in supper classHHH-2012Resolved issue: HHH-2012
- SchemaUpdateHHH-2008Resolved issue: HHH-2008
- Hibernate doesn't support optional one-to-one associationsHHH-2007Resolved issue: HHH-2007
- CLONE -Sequences generated in PostgreSQL not respect curent table schema name.HHH-1997Resolved issue: HHH-1997
- Deleted object remains referenced in 2nd level cache collectionsHHH-1989Resolved issue: HHH-1989
- javassist throws InvocationTargetException instead of original checked ExceptionHHH-1986Resolved issue: HHH-1986Steve Ebersole
- HQL update inserts wrong value for enumHHH-1978Resolved issue: HHH-1978
- SortedSet property won't get sortedHHH-1977Resolved issue: HHH-1977
- Unicode characters are not correctly stored in MSSQLHHH-1973Resolved issue: HHH-1973Strong Liu
- Incorrect join formed when for one-to-one relationship to subclass in a mixed table/class table/subclass mapping strategyHHH-1967Resolved issue: HHH-1967
- Schema validation fails with floating point column in Oracle 10gHHH-1961Resolved issue: HHH-1961
- Database Dialect for Progress 9.1DHHH-1950Resolved issue: HHH-1950Christian Beikov
- Interfaces PreInsertEventListener and PreUpdateEventListener are badly javadoc-documentedHHH-1942Resolved issue: HHH-1942Diego Plentz
- Hibernate produces invalid "create table" SQL for Maps on SQL Server 2000HHH-1935Resolved issue: HHH-1935
50 of 103
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.