From: <hib...@li...> - 2006-03-08 19:57:43
|
Author: ste...@jb... Date: 2006-03-08 14:57:35 -0500 (Wed, 08 Mar 2006) New Revision: 9577 Modified: trunk/Hibernate3/src/org/hibernate/impl/SessionImpl.java Log: minor Modified: trunk/Hibernate3/src/org/hibernate/impl/SessionImpl.java =================================================================== --- trunk/Hibernate3/src/org/hibernate/impl/SessionImpl.java 2006-03-08 05:18:12 UTC (rev 9576) +++ trunk/Hibernate3/src/org/hibernate/impl/SessionImpl.java 2006-03-08 19:57:35 UTC (rev 9577) @@ -221,21 +221,25 @@ } public Session getSession(EntityMode entityMode) { + if ( this.entityMode == entityMode ) { + return this; + } + if ( rootSession != null ) { rootSession.getSession( entityMode ); } + errorIfClosed(); checkTransactionSynchStatus(); - if ( this.entityMode == entityMode ) { - return this; - } - + SessionImpl rtn = null; if ( childSessionsByEntityMode == null ) { childSessionsByEntityMode = new HashMap(); } + else { + rtn = (SessionImpl) childSessionsByEntityMode.get( entityMode ); + } - SessionImpl rtn = (SessionImpl) childSessionsByEntityMode.get( entityMode ); if ( rtn == null ) { rtn = new SessionImpl( this, entityMode ); childSessionsByEntityMode.put( entityMode, rtn ); |