/** * Constructs a PersistentContext, bound to the given session. * * @param session The session "owning" this context. */ public StatefulPersistenceContext(SessionImplementor session) { this.session = session; entitiesByKey = new HashMap( INIT_COLL_SIZE ); entitiesByUniqueKey = new HashMap( INIT_COLL_SIZE ); proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK ); entitySnapshotsByKey = new HashMap( INIT_COLL_SIZE ); entityEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE ); collectionEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE ); collectionsByKey = new HashMap( INIT_COLL_SIZE ); arrayHolders = IdentityMap.instantiate( INIT_COLL_SIZE ); nullifiableEntityKeys = new HashSet(); initTransientState(); }
/** * Constructs a PersistentContext, bound to the given session. * * @param session The session "owning" this context. */ public PersistenceContext(SessionImplementor session) { this.session = session; entitiesByKey = new HashMap(INIT_MAP_SIZE); entitiesByUniqueKey = new HashMap(INIT_MAP_SIZE); proxiesByKey = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK); entitySnapshotsByKey = new HashMap(INIT_MAP_SIZE); //nonExistantEntityKeys = new HashSet(INIT_MAP_SIZE); //nonExistentEntityUniqueKeys = new HashSet(INIT_MAP_SIZE); entityEntries = IdentityMap.instantiateSequenced(INIT_MAP_SIZE); collectionEntries = IdentityMap.instantiateSequenced(INIT_MAP_SIZE); collectionsByKey = new HashMap(INIT_MAP_SIZE); arrayHolders = IdentityMap.instantiate(INIT_MAP_SIZE); initTransientState(); }
rtn.entityEntries = IdentityMap.instantiateSequenced( count < INIT_COLL_SIZE ? INIT_COLL_SIZE : count ); for ( int i = 0; i < count; i++ ) { Object entity = ois.readObject();