[hibernate-commits] Hibernate SVN: r10595 - branches/Branch_3_2/Hibernate3/src/org/hibernate/impl
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Oct 17 17:18:18 EDT 2006
Author: steve.ebersole at jboss.com
Date: 2006-10-17 17:18:17 -0400 (Tue, 17 Oct 2006)
New Revision: 10595
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java
Log:
HHH-1663 : <any/> mappings during flush
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java 2006-10-17 21:17:39 UTC (rev 10594)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java 2006-10-17 21:18:17 UTC (rev 10595)
@@ -1719,7 +1719,13 @@
public String bestGuessEntityName(Object object) {
if (object instanceof HibernateProxy) {
- object = ( (HibernateProxy) object ).getHibernateLazyInitializer().getImplementation();
+ LazyInitializer initializer = ( ( HibernateProxy ) object ).getHibernateLazyInitializer();
+ // it is possible for this method to be called during flush processing,
+ // so make certain that we do not accidently initialize an uninitialized proxy
+ if ( initializer.isUninitialized() ) {
+ return initializer.getEntityName();
+ }
+ object = initializer.getImplementation();
}
EntityEntry entry = persistenceContext.getEntry(object);
if (entry==null) {
More information about the hibernate-commits
mailing list