[hibernate-commits] Hibernate SVN: r11483 - trunk/Hibernate3/src/org/hibernate/persister/entity.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue May 8 17:36:07 EDT 2007
Author: steve.ebersole at jboss.com
Date: 2007-05-08 17:36:07 -0400 (Tue, 08 May 2007)
New Revision: 11483
Modified:
trunk/Hibernate3/src/org/hibernate/persister/entity/AbstractEntityPersister.java
Log:
HHH-2602 : instrumented many-to-one and aggresive release
Modified: trunk/Hibernate3/src/org/hibernate/persister/entity/AbstractEntityPersister.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/persister/entity/AbstractEntityPersister.java 2007-05-08 14:55:29 UTC (rev 11482)
+++ trunk/Hibernate3/src/org/hibernate/persister/entity/AbstractEntityPersister.java 2007-05-08 21:36:07 UTC (rev 11483)
@@ -764,8 +764,7 @@
final Object entity,
final SessionImplementor session,
final Serializable id,
- final EntityEntry entry
- ) {
+ final EntityEntry entry) {
if ( !hasLazyProperties() ) {
throw new AssertionFailure("no lazy properties");
@@ -780,12 +779,13 @@
ResultSet rs = null;
try {
final String lazySelect = getSQLLazySelectString();
- if (lazySelect!=null) {
- // null sql means the lazy properties do not map to
- // columns or formulas (eg. one-to-one associations)
+ if ( lazySelect != null ) {
+ // null sql means that the only lazy properties
+ // are shared PK one-to-one associations which are
+ // handled differently in the Type#nullSafeGet code...
ps = session.getBatcher().prepareSelectStatement(lazySelect);
getIdentifierType().nullSafeSet( ps, id, 1, session );
- rs = ps.executeQuery();
+ rs = session.getBatcher().getResultSet( ps );
rs.next();
}
final Object[] snapshot = entry.getLoadedState();
@@ -795,12 +795,12 @@
result = propValue;
}
}
+ }
+ finally {
if ( rs != null ) {
- rs.close();
+ session.getBatcher().closeQueryStatement( ps, rs );
}
- }
- finally {
- if ( ps != null ) {
+ else if ( ps != null ) {
session.getBatcher().closeStatement( ps );
}
}
More information about the hibernate-commits
mailing list