public void afterLoading ( CollectionProxyDefaultImpl colProxy ) { if ( log . isDebugEnabled ( ) ) log . debug ( "loading a proxied collection a collection: " + colProxy ) ; Collection data = colProxy . getData ( ) ; for ( Iterator iterator = data . iterator ( ) ; iterator . hasNext ( ) ; ) { Object o = iterator . next ( ) ; if ( ! isOpen ( ) ) { log . error ( "Collection proxy materialization outside of a running tx, obj=" + o ) ; try { throw new Exception ( "Collection proxy materialization outside of a running tx, obj=" + o ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } else { Identity oid = getBroker ( ) . serviceIdentity ( ) . buildIdentity ( o ) ; ClassDescriptor cld = getBroker ( ) . getClassDescriptor ( ProxyHelper . getRealClass ( o ) ) ; RuntimeObject rt = new RuntimeObject ( o , oid , cld , false , ProxyHelper . isProxy ( o ) ) ; lockAndRegister ( rt , Transaction . READ , isImplicitLocking ( ) , getRegistrationList ( ) ) ; } } unregisterFromCollectionProxy ( colProxy ) ; }
Remove colProxy from list of pending collections and register its contents with the transaction .