Updated recently

DefaultMergeEventListener.unproxyManagedForDetachedMerging fails if parameter managed is a HibernateProxy
HHH-13624
TransientObjectException merging a non-proxy association to a HibernateProxy
HHH-13590
Generating an ID with org.hibernate.id.enhanced.TableGenerator can hang the application if HIBERNATE_SEQUENCES has NULL value
HHH-8535
NPE on flushing when ElementCollection field contains null element
HHH-13651
lock optimistic_force_increment is not working when an entityManager.clear() is called
HHH-13688
Wrap ServiceLoader calls (via ClassLoaderService#loadJavaServices) in privileged blocks
HHH-13188
TenantSchemaResolver not called in integration test after upgrade from 5.4.4 to >=5.4.5
HHH-13687
Upgrade to Agroal 1.6
HHH-13686
Upgrade to Gradle 5
HHH-13685
Bugs join-fetching a collection when scrolling with a stateless session using enhancement as proxy
HHH-13633
AssertionFailure: Exception releasing cache locks upon After/BeforeTransactionCompletionProcess failure
HHH-13666
Selecting an entity annotated with @Immutable but not with @Cachable causes a NPE when use_reference_entries is enabled
HHH-13665
MapBinder.createFormulatedValue() does not honor DB schema name when creating query
HHH-4235
Have EntityManagerFactory expose persistence.xml `jta-data-source` element as a `javax.persistence.nonJtaDataSource` property
HHH-13432
PersistenceContext can get cleared before load completes using StatelessSessionImpl
HHH-13634
Cryptic error when providing import.sql file without a terminal char at the end of each line
HHH-13673
The temporary PersistenceContext of a StatelessSession is not cleared after a refresh operation
HHH-13672
integration overrides during JPA bootstrap ought to override all logically related settings
HHH-12858
Reduce allocation costs of IdentityMaps used by ResultSetProcessingContextImpl
HHH-13660
Upgrade to Byteman 4.0.8
HHH-13681
Optimize PersistentBag.groupByEqualityHash()
HHH-13675
Upgrade to Byte Buddy 1.10.2
HHH-13680
Uninitialized HibernateProxy mapped as NO_PROXY gets initialized when reloaded with enhancement-as-proxy enabled
HHH-13640
Uninitialized entity does not get initialized when a setter is called with enhancement-as-proxy enabled
HHH-13653
Avoid initializing XmlMappingBinderAccess when no XML mappings are defined
HHH-13662
_MOD columns not named correctly when using custom column names
HHH-10398
Envers Map<Enum, Integer> causes NullPointerException when mapped with @MapKeyEnumerated since Hibernate 5.4.6
HHH-13655
Session#setHibernateFlushMode() method not callable without an active transaction
HHH-13663
Avoid clearing of collections when closing StatefulPersistenceContext
HHH-13654
EntityManager.find() should only check for roll-back-only condition if there is an active JTA transaction, otherwise ORM should throw convert( e, lockOptions )
HHH-13433
Avoid annotation readings in or lazy initialization of AbstractServiceRegistryImpl
HHH-13669
EntityManager#lock throws throws OptimisticLockException using LockModeType.PESSIMISTIC_WRITE if entity doesn't exist in dataase
HHH-13659
REGEXP_REPLACE as a function to hibernates Oracle dialect
HHH-13648
Allow the IntegratorProvider to be supplied via its FQN in the JPA persistence.xml
HHH-13614
Improve CacheImplementor SPI to better support a DomainDataRegion and QueryResultsRegion with the same name
HHH-13613
Quoted table name in FROM clause and Column in @Formula gets wrongly qualified with generated alias
HHH-13612
Oracle8iDialect should use CASE_INSENSITIVE pattern matching when checking the statement type
HHH-13608
Document capability to log slow queries (HHH-13249)
HHH-13539
IllegalArgumentException: Parameter value [...] did not match expected type
HHH-13501
possible regression since 5.2.15: StaleStateException for updates to multi-table entities
HHH-13355
Documentation should state how to configure javassist as bytecode provider
HHH-13346
EnhancementException using Javassist bidirectional association management with many-to-one in embeddable
HHH-13317
IdentifierLoadAccessImpl and MultiIdentifierLoadAccessImpl fails when RootGraph is set.
HHH-13312
On release of batch it still contained JDBC statements
HHH-13307
Use FetchMode.Join to load OneToOne associations that have the same AssociationKey as the entity owner
HHH-13085
Optimize query plan call count
HHH-13077
Hibernate should log a warning if a "mappedBy" side of a *-to-one association has @NotFound(IGNORE) mapped
HHH-13066
Hibernate should throw an exception if a non-optional association also maps @NotFound(IGNORE)
HHH-13065
Hibernate Envers Audit tables are created with foreign key with the entity. Because of this I am not able to delete any entries from the entity tables.
HHH-12965
Upgrade DB2400 dialect to use the DB2 for i improvements
HHH-12856
issue 1 of 71

DefaultMergeEventListener.unproxyManagedForDetachedMerging fails if parameter managed is a HibernateProxy

Description

The method DefaultMergeEventListener.unproxyManagedForDetachedMerging contains a bug in case the parameter managed is a HibernateProxy. It results in a StaleObjectStateException because DefaultMergeEventListener.isVersionChanged() always return true.

The code in DefaultMergeEventListener.unproxyManagedForDetachedMerging
if ( incoming instanceof HibernateProxy ) {
return source.getPersistenceContextInternal().unproxy( managed );
}

should be replaced by
if ( managed instanceof HibernateProxy ) {
return source.getPersistenceContextInternal().unproxy( managed );
}

to make it working again.

Environment

Hibernate ORM 5.4.4, JVM 11.0.2, Windows 10, Oracle 12

Status

Assignee

Gail Badner

Reporter

Reto Urfer

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.0

Components

Affects versions

5.4.4

Priority

Blocker
Configure