Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader
In directory sc8-pr-cvs1:/tmp/cvs-serv25747/hibernate/loader
Modified Files:
CollectionLoader.java Loader.java OneToManyLoader.java
Log Message:
* fixed a theoretical problem with caching and queued adds
* fixed a real problem with sorted sets
* re-enabled two-phase loading for sets
Index: CollectionLoader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionLoader.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CollectionLoader.java 23 Feb 2003 07:22:11 -0000 1.10
--- CollectionLoader.java 2 Apr 2003 01:06:53 -0000 1.11
***************
*** 26,30 ****
private final CollectionPersister collectionPersister;
private final Type idType;
- private final boolean allowTwoPhaseLoad;
public CollectionLoader(CollectionPersister persister, SessionFactoryImplementor session) throws MappingException {
--- 26,29 ----
***************
*** 32,37 ****
super( session.getDialect() );
- allowTwoPhaseLoad = !persister.isSet();
-
idType = persister.getKeyType();
--- 31,34 ----
***************
*** 78,85 ****
public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException {
loadCollection(session, id, idType, owner, collection);
- }
-
- protected boolean allowTwoPhaseLoad() {
- return allowTwoPhaseLoad;
}
--- 75,78 ----
Index: Loader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Loader.java 20 Mar 2003 13:59:09 -0000 1.15
--- Loader.java 2 Apr 2003 01:06:53 -0000 1.16
***************
*** 66,71 ****
}
/**
! * Are we allowed to do two-phase loading? (we aren't for some special cases
! * like sets of entities ... actually only that one special case)
*/
protected boolean allowTwoPhaseLoad() {
--- 66,71 ----
}
/**
! * Are we allowed to do two-phase loading?
! * @deprecated we always do two-phase loading now
*/
protected boolean allowTwoPhaseLoad() {
***************
*** 119,122 ****
--- 119,124 ----
final ResultSet rs = getResultSet(st, namedParams, selection, session);
+ if (collection) optionalCollection.beginRead();
+
try {
***************
*** 178,181 ****
--- 180,185 ----
while ( iter.hasNext() ) session.initializeEntity( iter.next() );
}
+
+ if (collection) optionalCollection.endRead();
return results;
Index: OneToManyLoader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OneToManyLoader.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** OneToManyLoader.java 23 Feb 2003 07:22:11 -0000 1.11
--- OneToManyLoader.java 2 Apr 2003 01:06:53 -0000 1.12
***************
*** 27,31 ****
private final CollectionPersister collectionPersister;
private final Type idType;
- private final boolean allowTwoPhaseLoad;
public OneToManyLoader(CollectionPersister collPersister, SessionFactoryImplementor session) throws MappingException {
--- 27,30 ----
***************
*** 33,38 ****
super( session.getDialect() );
- allowTwoPhaseLoad = !collPersister.isSet();
-
collectionPersister = collPersister;
--- 32,35 ----
***************
*** 92,99 ****
public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException {
loadCollection(session, id, idType, owner, collection);
- }
-
- protected boolean allowTwoPhaseLoad() {
- return allowTwoPhaseLoad;
}
--- 89,92 ----
|