/** * Retrieves a local object valid for thus current transaction. * * @param profilePojo * @return * @throws TransactionRequiredLocalException */ ProfileObjectImpl getProfileObjectValidInCurrentTransaction(ProfileEntity profileEntity) throws TransactionRequiredLocalException { // check tx final SleeTransactionManager txManager = profileManagement.getSleeContainer().getTransactionManager(); txManager.mandateTransaction(); // look for an assigned object in local map if (txData == null) { txData = new HashMap<ProfileEntity, ProfileObjectImpl>(); } ProfileObjectImpl profileObject = (ProfileObjectImpl) txData.get(profileEntity); if (profileObject == null) { // get an object from the table profileEntity.setReadOnly(true); profileEntity.setDirty(false); ProfileObjectPool pool = profileManagement.getObjectPoolManagement().getObjectPool(profileEntity.getTableName()); profileObject = pool.borrowObject(); profileObject.profileActivate(profileEntity); ProfileTableTransactionView.passivateProfileObjectOnTxEnd(txManager, profileObject, pool); txData.put(profileEntity, profileObject); } return profileObject; }
/** * * @param profileName * @return * @throws TransactionRequiredLocalException * @throws SLEEException * @throws CreateException */ public ProfileObjectImpl createProfile(String profileName) throws TransactionRequiredLocalException, SLEEException, CreateException { Map txData = getTxData(); ProfileTransactionID key = new ProfileTransactionID(profileName, profileTable.getProfileTableName()); ProfileObjectImpl value = (ProfileObjectImpl) txData.get(key); if (value == null) { ProfileObjectPool pool = profileTable.getProfileManagement() .getObjectPoolManagement().getObjectPool( profileTable.getProfileTableName()); value = pool.borrowObject(); passivateProfileObjectOnTxEnd(profileTable.getSleeContainer() .getTransactionManager(), value, pool); value.profileCreate(profileName); txData.put(key, value); } return value; }
profileManagement.getObjectPoolManagement().removeObjectPool(this, sleeContainer.getTransactionManager());
/** * * Retrieves a profile object for the table and specified profile entity, * there is only one profile object per profile entity per transaction * * @param profileEntity * @return * @throws TransactionRequiredLocalException * @throws SLEEException */ public ProfileObjectImpl getProfile(ProfileEntity profileEntity) throws TransactionRequiredLocalException, SLEEException { Map txData = getTxData(); ProfileTransactionID key = new ProfileTransactionID(profileEntity .getProfileName(), profileTable.getProfileTableName()); ProfileObjectImpl value = (ProfileObjectImpl) txData.get(key); if (value == null) { ProfileObjectPool pool = profileTable.getProfileManagement() .getObjectPoolManagement().getObjectPool( profileTable.getProfileTableName()); value = pool.borrowObject(); passivateProfileObjectOnTxEnd(profileTable.getSleeContainer() .getTransactionManager(), value, pool); value.profileActivate(profileEntity); txData.put(key, value); } return value; }
if (value == null) { ProfileObjectPool pool = profileTable.getProfileManagement() .getObjectPoolManagement().getObjectPool( profileTable.getProfileTableName()); value = pool.borrowObject();