Issues
- Hibernate increases version on readHHH-5867Resolved issue: HHH-5867Strong Liu
- ClassCastException with parameter as CASE resultsHHH-4700Resolved issue: HHH-4700Steve Ebersole
- 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
- HQL Query using the relationary operator "or"HHH-2689Resolved issue: HHH-2689
- Hibernate Serializable classes do not declare serialVersionUIDHHH-2586Resolved issue: HHH-2586
- unexpected object loading with Mixing table per class hierarchy with table per subclassHHH-2422Resolved issue: HHH-2422
- replicate() of non-versioned entiy can result in wrong value for version in entity cacheHHH-2378Resolved issue: HHH-2378Max Rydahl Andersen
- enhancements to C3P0ConnectionProviderHHH-2371Resolved issue: HHH-2371Steve Ebersole
- ClassCastException thrown in org.hibernate.hql.ast.HqlSqlWalker.resolveHHH-2353Resolved issue: HHH-2353
- Regression: optional properties under a <join> tag no longer update properlyHHH-2320Resolved issue: HHH-2320Former user
- Not-Null Constraint-Violation with unidirectional one-to-many mappingHHH-2280Resolved issue: HHH-2280Former user
- hbm2ddl=update with mysql5 & innodb: should update foreign key definitionHHH-2263Resolved issue: HHH-2263
- Criteria search does not work with association mapped in <properties> tagHHH-2191Resolved issue: HHH-2191
- bulk update with native sql queriesHHH-2147Resolved issue: HHH-2147
- @ForceDiscriminator does not work when fetching an associated entityHHH-2137Resolved issue: HHH-2137
- Comment before PersistentBag#getDeletes() about bags and one-to-manyHHH-2132
- data corruption using one-to-one mappingHHH-2128Resolved issue: HHH-2128
- collection not getting filtered to requested subclassesHHH-2126Resolved issue: HHH-2126
- 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
- clarification on the way interceptors and event system interact.HHH-2123Resolved issue: HHH-2123Vlad Mihalcea
- composite-id master-detail doesn't bound correctly variablesHHH-2121Resolved issue: HHH-2121
- hibernate cant find dialect class and drivers cause of blanks in hibernate.property fileHHH-2118Resolved issue: HHH-2118Diego Plentz
- Incorrect join ordering with filters and JOINED inheritanceHHH-2113Resolved issue: HHH-2113
- ClassCastException in StatefulPersistenceContext.getCachedDatabaseSnapshot(...)HHH-2112Resolved issue: HHH-2112Steve Ebersole
- cacheable files brokenHHH-2108Resolved issue: HHH-2108Steve Ebersole
- DefaultLoadEventListener throws TypeMismatchException for EntityMode.MAP for component type when it should notHHH-2107Resolved issue: HHH-2107
- Rolling back 'SELECT is mandatory' on JPA strict complianceHHH-2103Resolved issue: HHH-2103Emmanuel Bernard
- LAZY property results in org.hibernate.TransientObjectException after mergeHHH-2097Resolved issue: HHH-2097
- Hibernate is ignoring native sql aliases and generating "column not found" errorHHH-2094Resolved issue: HHH-2094
- PERSIST_ON_FLUSH ineffective for recursive object graphsHHH-2093Resolved issue: HHH-2093Emmanuel Bernard
- Programmatic config and XML config react differently to the same propety names (when not prefaced with "hibernate")HHH-2092Resolved issue: HHH-2092
- Adding mappings to Configuration before FilterDefinition leads to NullPointerExceptionHHH-2091Resolved issue: HHH-2091
- ClobType.setToXMLNode: could not read XML from ClobHHH-2089Resolved issue: HHH-2089
- TypeMismatchException on object equality expression from one-to-one relationshipHHH-2088Resolved issue: HHH-2088Former user
- lazy="extra" on Set's is broken - operationQueue is not considered when accessing setHHH-2087Resolved issue: HHH-2087
- Patch for bug HHH-2076 and to be able to use <formula> in <key> for <one-to-many>HHH-2086Resolved issue: HHH-2086
- UpdateTimestampsCache.isUpToDate returns before checking all spacesHHH-2082Resolved issue: HHH-2082Steve Ebersole
- NodeTraverser throws unhandled IllegalArgumentException on bogus queryHHH-2080Resolved issue: HHH-2080
- Providing an escape sequence for Criteria queriesHHH-2077Resolved issue: HHH-2077
- Bidirectionnal many-to-one with formula and one-to-one doesn't workHHH-2076Resolved issue: HHH-2076
- many-to-one in a properties element causes strange PropertyValueException on flushHHH-2075Resolved issue: HHH-2075
- complain if subclass and joined-subclass extends are used at the same timeHHH-2072Resolved issue: HHH-2072
- org.hibernate.cfg.SecondPass (wrong interface)HHH-2071Resolved issue: HHH-2071
- Expand DB2Dialect auto-discovery support (Martin Renner)HHH-2070Resolved issue: HHH-2070Steve Ebersole
- TransientObjectException : object references an unsaved transient instance ...HHH-2068Resolved issue: HHH-2068Former user
- HSQL DB + multi-schema --> raised an exception (Problem to get an increment key [select max(id) from table)HHH-2066Resolved issue: HHH-2066
50 of 64
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.