protected EnterpriseContext acquireContext() throws Exception { return m_container.getInstancePool().get(); }
protected void freeContext(EnterpriseContext ctx) { m_container.getInstancePool().free(ctx); }
public Map retrieveStatistic() { // Loop through all Interceptors and add statistics Map lStatistics = new HashMap(); StatisticsProvider lProvider = (StatisticsProvider) getPersistenceManager(); lStatistics.putAll( lProvider.retrieveStatistic() ); lProvider = (StatisticsProvider) getInstancePool(); lStatistics.putAll( lProvider.retrieveStatistic() ); return lStatistics; }
public EnterpriseContext get(Object id) throws RemoteException, NoSuchObjectException { if(id == null) throw new IllegalArgumentException("Can't get an object with a null key"); Map cache = getLocalCache(); EntityEnterpriseContext instance = (EntityEnterpriseContext) cache.get(id); if(instance == null) { try { // acquire instance = (EntityEnterpriseContext) container.getInstancePool().get(); // set key instance.setId(id); instance.setCacheKey(id); // activate container.getPersistenceManager().activateEntity(instance); // insert cache.put(id, instance); } catch(Throwable x) { throw new NoSuchObjectException(x.getMessage()); } } return instance; }
container.getInstancePool().free(ctx);
EntityEnterpriseContext entity = (EntityEnterpriseContext) instance; container.getPersistenceManager().passivateEntity(entity); container.getInstancePool().free(instance);
EntityEnterpriseContext ctx = (EntityEnterpriseContext) ec.getInstancePool().get(); ec.getInstancePool().free(ctx);
InstancePool pool = ec.getInstancePool(); try
container.getInstancePool().free(ctx);
EntityEnterpriseContext ctx = (EntityEnterpriseContext) container.getInstancePool().get(); ctx.setTxAssociation(GlobalTxEntityMap.NOT_READY); InstancePool pool = container.getInstancePool(); container.getInstancePool().free(ctx); return obj;