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
- Hibernate Serializable classes do not declare serialVersionUIDHHH-2586Resolved issue: HHH-2586
- replicate() of non-versioned entiy can result in wrong value for version in entity cacheHHH-2378Resolved issue: HHH-2378Max Rydahl Andersen
- INFINITE loop with HQL Query using select new SomeClass(queryclass)HHH-2213Resolved issue: HHH-2213
- Invalid column name SQL Error: 17006, SQLState: nullHHH-2129Resolved issue: HHH-2129
- 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
- Problem deleting entities in hierarchyHHH-2098Resolved issue: HHH-2098Diego Plentz
- Providing an escape sequence for Criteria queriesHHH-2077Resolved issue: HHH-2077
- 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
- There is an bug in InformixDialect preventing generator-class=native to work.HHH-2043Resolved issue: HHH-2043
- many-to-any IN condition query problemHHH-2030Resolved issue: HHH-2030
- default value for hibernate.connection.release_mode is not correctHHH-2029Resolved issue: HHH-2029
- IncrementGenerator broken for tables with blanks in their names after TODO-173HHH-2028Resolved issue: HHH-2028
- property names beginning with underscores cause Hibernate to generate invalid aliasesHHH-2022Resolved issue: HHH-2022Steve Ebersole
- where= does not set parenthesis leading to unexpected query when multiclause are usedHHH-2015Resolved issue: HHH-2015Emmanuel Bernard
- org.hibernate.type.SortedSetType does not overwrite instantiate(int anticipatedSize)HHH-2014Resolved issue: HHH-2014
- getForUpdateString is not correct in DB2Dialect; session.lock doesn't work as expected.HHH-2010Resolved issue: HHH-2010Diego Plentz
- org.hibernate.pretty.Printer assumes ClassMetadata.getPropertyNames & getPropertyValues have the same orderHHH-2009Resolved issue: HHH-2009
- Collections which are fetched AND restricted should not be written to second-level cacheHHH-2003
- javaassist does not setup the proper protection domain thus does not work with signed/secured deployments such as webstartHHH-2001Resolved issue: HHH-2001Steve Ebersole
- <collection-id> does not work with post insert id generators (esp identity generator)HHH-1998Resolved issue: HHH-1998
- Renaming package/classes breaks Hibernate annontations 3.2.0CR1HHH-1993Resolved issue: HHH-1993
- Some cascade actions should not trigger a property access on lazy propertiesHHH-1992Resolved issue: HHH-1992Emmanuel Bernard
- Repeated column chack fails with SingleTable inheritance, biut not with TablePerClassHHH-1988Resolved issue: HHH-1988
- NodeTraverser is not SOE-safeHHH-1985Resolved issue: HHH-1985Strong Liu
- GenericJDBCException: Cannot release connectionHHH-1971Resolved issue: HHH-1971
- Table aliases constructed incorrectly from HQL when JOIN is used when selecting multiple objectsHHH-1969Resolved issue: HHH-1969
- Almost impossible to subclassing DetachedCriteriaHHH-1964Resolved issue: HHH-1964
- meta inheritance brokenHHH-1963Resolved issue: HHH-1963
- Callable update/insert/delete statements should not force rowcount out parameter in AbstractEntityPersisterHHH-1959Resolved issue: HHH-1959
- session.lock(LockMode.FORCE) can lead to NPEHHH-1958Resolved issue: HHH-1958Emmanuel Bernard
- Proxies are never unassociated (evicted) from a sessionHHH-1954Resolved issue: HHH-1954Steve Ebersole
- Database Dialect for Progress 9.1DHHH-1950Resolved issue: HHH-1950Christian Beikov
- having trim(BOTH from c.name) translated into having ltrim(rtrim(BOTH)) on DB2HHH-1949Resolved issue: HHH-1949Steve Ebersole
- Query Idetification variables are case insensitive in JPAHHH-1948Resolved issue: HHH-1948Steve Ebersole
- OF part of MEMBER OF is optionalHHH-1947Resolved issue: HHH-1947Steve Ebersole
- OrderedSetType.instantiate() should be OrderedSetType.instantiate(int) to override SetType.instantiate(int)HHH-1945Resolved issue: HHH-1945
- generated subqueries and jpaql compliance (derived select clause) checkHHH-1944Resolved issue: HHH-1944Steve Ebersole
- PersistenceContext not checked to see whether the associated entity is transient or notHHH-1943Resolved issue: HHH-1943Emmanuel Bernard
- Interfaces PreInsertEventListener and PreUpdateEventListener are badly javadoc-documentedHHH-1942Resolved issue: HHH-1942Diego Plentz
- Be more specific about x not found and invalid mapping exceptions to allow tools to tell about itHHH-1941Resolved issue: HHH-1941Max Rydahl Andersen
- Proxy creation may fails when duplicate methods are used by the compilerHHH-1938Resolved issue: HHH-1938Steve Ebersole
50 of 65
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.