From: <one...@us...> - 2003-04-19 03:26:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/collection Modified Files: Bag.java CollectionPersister.java PersistentCollection.java Log Message: * SessionFactory.close() now unbinds from JNDI * added Session.remove() * got rid of another unnecessry collection delete() Index: Bag.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Bag.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Bag.java 6 Apr 2003 10:11:07 -0000 1.10 --- Bag.java 19 Apr 2003 03:26:07 -0000 1.11 *************** *** 171,175 **** } ! public boolean needsRecreate(Type elemType) throws HibernateException { return true; } --- 171,175 ---- } ! public boolean needsRecreate() throws HibernateException { return true; } Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CollectionPersister.java 18 Apr 2003 05:09:49 -0000 1.19 --- CollectionPersister.java 19 Apr 2003 03:26:07 -0000 1.20 *************** *** 206,210 **** } - public CollectionInitializer getInitializer() { return loader; --- 206,209 ---- *************** *** 219,222 **** --- 218,222 ---- public void cache(Serializable id, PersistentCollection coll, SessionImplementor s) throws HibernateException { if (cache!=null) { + if ( log.isDebugEnabled() ) log.debug("Caching collection: " + role + '#' + id); cache.put( id, coll.disassemble(this), s.getTimestamp() ); } *************** *** 228,231 **** --- 228,232 ---- } else { + if ( log.isDebugEnabled() ) log.debug("Searching for collection in cache: " + role + '#' + id); Serializable cached = (Serializable) cache.get( id, s.getTimestamp() ); if (cached==null) { *************** *** 514,517 **** --- 515,520 ---- } + if ( log.isDebugEnabled() ) log.debug("done deleting collection"); + } *************** *** 547,550 **** --- 550,558 ---- throw sqle; } + + if ( log.isDebugEnabled() ) log.debug("done inserting collection"); + } + else { + if ( log.isDebugEnabled() ) log.debug("collection was empty"); } } *************** *** 575,578 **** --- 583,591 ---- throw sqle; } + + if ( log.isDebugEnabled() ) log.debug("done deleting collection rows"); + } + else { + if ( log.isDebugEnabled() ) log.debug("no rows to delete"); } } *************** *** 659,662 **** --- 672,677 ---- update(id, collection, session); } + + if ( log.isDebugEnabled() ) log.debug("done updating rows"); } } *************** *** 689,692 **** --- 704,709 ---- throw sqle; } + + if ( log.isDebugEnabled() ) log.debug("done inserting rows"); } } Index: PersistentCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/PersistentCollection.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PersistentCollection.java 6 Apr 2003 10:11:07 -0000 1.12 --- PersistentCollection.java 19 Apr 2003 03:26:07 -0000 1.13 *************** *** 159,162 **** --- 159,172 ---- } + public final boolean unsetSession(SessionImplementor session) { + if (session==this.session) { + this.session=null; + return true; + } + else { + return false; + } + } + public final boolean setSession(SessionImplementor session) throws HibernateException { if (session==this.session) { *************** *** 190,194 **** public abstract Serializable disassemble(CollectionPersister persister) throws HibernateException; ! public boolean needsRecreate(Type elemType) throws HibernateException { return false; } --- 200,204 ---- public abstract Serializable disassemble(CollectionPersister persister) throws HibernateException; ! public boolean needsRecreate() throws HibernateException { return false; } |