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
- 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
- List-index defenition needs to be updatedHHH-1176Resolved issue: HHH-1176
- 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
- More then one column having the same nameHHH-1072Resolved issue: HHH-1072
- Unnecessary commas generated in select with left outer joinsHHH-1069Resolved issue: HHH-1069Steve Ebersole
- Cannot use comparator classHHH-991Resolved issue: HHH-991
- The problem continues -Class with mapped composite id can't have subclassesHHH-976Resolved issue: HHH-976
- Patch to allow subqueries with joins using Criteria API and Subqueries with DetachedCriteriaHHH-952Resolved issue: HHH-952Former user
- Querying collections of value type in the Criteria APIHHH-869Resolved issue: HHH-869
- Missing parens after / or -HHH-868Resolved issue: HHH-868GavinG
- post-commit eventsHHH-859Resolved issue: HHH-859GavinG
- Autocommit status inconsistent in connections created by DriverManagerConnectionProviderHHH-858Resolved issue: HHH-858
- Classfile version error under JDK 1.3 (3.1 beta)HHH-857Resolved issue: HHH-857
- Class with mapped composite id can't have subclassesHHH-854Resolved issue: HHH-854
- Cartesian product + implicit joinsHHH-849Resolved issue: HHH-849Steve Ebersole
- Add Intializable interface for eventsHHH-846Resolved issue: HHH-846GavinG
- Transaction.setTimeout()HHH-838Resolved issue: HHH-838GavinG
- Improvements to caching lazy propertiesHHH-830Resolved issue: HHH-830
- <cache include="all|non-lazy" ... />HHH-829Resolved issue: HHH-829
- session.getTransaction()HHH-828Resolved issue: HHH-828
- Unnecessary commas generated in sub-select left outer joinsHHH-826Resolved issue: HHH-826Steve Ebersole
- ReadWrite-Cache issues NullPointerException after modification of an arrayHHH-825Resolved issue: HHH-825GavinG
- Implicit join creates unnecessary cartesian productHHH-816Resolved issue: HHH-816
- Error when using Expression.ilike with FirebirdHHH-811Resolved issue: HHH-811Strong Liu
- CGLIB Enhancement failed - Hibernate 3.1 beta 1HHH-810Resolved issue: HHH-810
- NullPointerException in method createFromJoinElement of class HqlSqlWalkerHHH-806Resolved issue: HHH-806
- EntityMode.DOM4J - Multiple many-to-one's to same object can cause incorrect names in XMLHHH-794Resolved issue: HHH-794
- SimpleExpression builds faulty SQL for multi-column propertiesHHH-793Resolved issue: HHH-793
- Use cascade styles when fetching entities in refresh() and merge()HHH-791Resolved issue: HHH-791GavinG
- Improve lazy options for <one-to-one>HHH-786Resolved issue: HHH-786GavinG
- Persistence through cascading should have higher precedence than orphan-deleteHHH-785Resolved issue: HHH-785
- Reading connection metadata starts transaction.HHH-784Resolved issue: HHH-784
- collection lazy="extra"HHH-783Resolved issue: HHH-783GavinG
- Avoid unnecessary updates when component property is update='false' but modifiedHHH-782Resolved issue: HHH-782
- SimpleExpression ignorecase regressionHHH-781Resolved issue: HHH-781
- bug in query parser with left outer join fetch forcing implicit right join through alias substitutionHHH-777Resolved issue: HHH-777
- 2x fetch HQL creates invalid queryHHH-776Resolved issue: HHH-776
- select clause subselectsHHH-741Resolved issue: HHH-741GavinG
- SchemaUpdate reads table metadata from wrong schemaHHH-735Resolved issue: HHH-735GavinG
50 of 53
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.