/** * Notification that we've been read-locked. Pass in the level at which * we were locked and the level at which we should write lock ourselves * on dirty. */ void readLocked(int readLockLevel, int writeLockLevel) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (readLockLevel != LockLevels.LOCK_NONE) transactional(); _readLockLevel = readLockLevel; _writeLockLevel = writeLockLevel; _flags |= FLAG_READ_LOCKED; _flags &= ~FLAG_WRITE_LOCKED; }
/** * Notification that we've been read-locked. Pass in the level at which * we were locked and the level at which we should write lock ourselves * on dirty. */ void readLocked(int readLockLevel, int writeLockLevel) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (readLockLevel != LockLevels.LOCK_NONE) transactional(); _readLockLevel = readLockLevel; _writeLockLevel = writeLockLevel; _flags |= FLAG_READ_LOCKED; _flags &= ~FLAG_WRITE_LOCKED; }
/** * Notification that we've been read-locked. Pass in the level at which * we were locked and the level at which we should write lock ourselves * on dirty. */ void readLocked(int readLockLevel, int writeLockLevel) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (readLockLevel != LockLevels.LOCK_NONE) transactional(); _readLockLevel = readLockLevel; _writeLockLevel = writeLockLevel; _flags |= FLAG_READ_LOCKED; _flags &= ~FLAG_WRITE_LOCKED; }
/** * Notification that we've been read-locked. Pass in the level at which * we were locked and the level at which we should write lock ourselves * on dirty. */ void readLocked(int readLockLevel, int writeLockLevel) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (readLockLevel != LockLevels.LOCK_NONE) transactional(); _readLockLevel = readLockLevel; _writeLockLevel = writeLockLevel; _flags |= FLAG_READ_LOCKED; _flags &= ~FLAG_WRITE_LOCKED; }
/** * Notification that we've been read-locked. Pass in the level at which * we were locked and the level at which we should write lock ourselves * on dirty. */ void readLocked(int readLockLevel, int writeLockLevel) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (readLockLevel != LockLevels.LOCK_NONE) transactional(); _readLockLevel = readLockLevel; _writeLockLevel = writeLockLevel; _flags |= FLAG_READ_LOCKED; _flags &= ~FLAG_WRITE_LOCKED; }
/** * Transition the given state managers to transactional. */ private void transactionalStatesAll(Collection sms, Collection failed, List exceps) { // make instances transactional and make sure they are loaded StateManagerImpl sm; for (Iterator itr = sms.iterator(); itr.hasNext();) { sm = (StateManagerImpl) itr.next(); if (failed != null && failed.contains(sm.getId())) continue; try { sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); } catch (OpenJPAException ke) { exceps = add(exceps, ke); } } throwNestedExceptions(exceps, false); }
/** * Transition the given state managers to transactional. */ private void transactionalStatesAll(Collection sms, Collection failed, List<Exception> exceps) { // make instances transactional and make sure they are loaded StateManagerImpl sm; for (Iterator<?> itr = sms.iterator(); itr.hasNext();) { sm = (StateManagerImpl) itr.next(); if (failed != null && failed.contains(sm.getId())) continue; try { sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); } catch (OpenJPAException ke) { exceps = add(exceps, ke); } } throwNestedExceptions(exceps, false); }
/** * Transition the given state managers to transactional. */ private void transactionalStatesAll(Collection sms, Collection failed, List<Exception> exceps) { // make instances transactional and make sure they are loaded StateManagerImpl sm; for (Iterator<?> itr = sms.iterator(); itr.hasNext();) { sm = (StateManagerImpl) itr.next(); if (failed != null && failed.contains(sm.getId())) continue; try { sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); } catch (OpenJPAException ke) { exceps = add(exceps, ke); } } throwNestedExceptions(exceps, false); }
/** * Transition the given state managers to transactional. */ private void transactionalStatesAll(Collection sms, Collection failed, List<Exception> exceps) { // make instances transactional and make sure they are loaded StateManagerImpl sm; for (Iterator<?> itr = sms.iterator(); itr.hasNext();) { sm = (StateManagerImpl) itr.next(); if (failed != null && failed.contains(sm.getId())) continue; try { sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); } catch (OpenJPAException ke) { exceps = add(exceps, ke); } } throwNestedExceptions(exceps, false); }
/** * Transition the given state managers to transactional. */ private void transactionalStatesAll(Collection sms, Collection failed, List<Exception> exceps) { // make instances transactional and make sure they are loaded StateManagerImpl sm; for (Iterator<?> itr = sms.iterator(); itr.hasNext();) { sm = (StateManagerImpl) itr.next(); if (failed != null && failed.contains(sm.getId())) continue; try { sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); } catch (OpenJPAException ke) { exceps = add(exceps, ke); } } throwNestedExceptions(exceps, false); }
/** * Make sure we're locked at the given level. */ private void obtainLocks(boolean active, boolean forWrite, int lockLevel, FetchConfiguration fetch, Object sdata) { if (!active) return; // if we haven't been locked yet, lock now at the given level int flag = (forWrite) ? FLAG_WRITE_LOCKED : FLAG_READ_LOCKED; if ((_flags & flag) == 0) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (lockLevel != LockLevels.LOCK_NONE) transactional(); if (fetch == null) fetch = _broker.getFetchConfiguration(); _broker.getLockManager().lock(this, lockLevel, fetch.getLockTimeout(), sdata); _flags |= FLAG_READ_LOCKED; _flags |= flag; } }
/** * Make sure we're locked at the given level. */ private void obtainLocks(boolean active, boolean forWrite, int lockLevel, FetchConfiguration fetch, Object sdata) { if (!active) return; // if we haven't been locked yet, lock now at the given level int flag = (forWrite) ? FLAG_WRITE_LOCKED : FLAG_READ_LOCKED; if ((_flags & flag) == 0) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (lockLevel != LockLevels.LOCK_NONE) transactional(); if (fetch == null) fetch = _broker.getFetchConfiguration(); _broker.getLockManager().lock(this, lockLevel, fetch.getLockTimeout(), sdata); _flags |= FLAG_READ_LOCKED; _flags |= flag; } }
/** * Make sure we're locked at the given level. */ private void obtainLocks(boolean active, boolean forWrite, int lockLevel, FetchConfiguration fetch, Object sdata) { if (!active) return; // if we haven't been locked yet, lock now at the given level int flag = (forWrite) ? FLAG_WRITE_LOCKED : FLAG_READ_LOCKED; if ((_flags & flag) == 0) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (lockLevel != LockLevels.LOCK_NONE) transactional(); if (fetch == null) fetch = _broker.getFetchConfiguration(); _broker.getLockManager().lock(this, lockLevel, fetch.getLockTimeout(), sdata); _flags |= FLAG_READ_LOCKED; _flags |= flag; } }
/** * Make sure we're locked at the given level. */ private void obtainLocks(boolean active, boolean forWrite, int lockLevel, FetchConfiguration fetch, Object sdata) { if (!active) return; // if we haven't been locked yet, lock now at the given level int flag = (forWrite) ? FLAG_WRITE_LOCKED : FLAG_READ_LOCKED; if ((_flags & flag) == 0) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (lockLevel != LockLevels.LOCK_NONE) transactional(); if (fetch == null) fetch = _broker.getFetchConfiguration(); _broker.getLockManager().lock(this, lockLevel, fetch.getLockTimeout(), sdata); _flags |= FLAG_READ_LOCKED; _flags |= flag; } }
/** * Make sure we're locked at the given level. */ private void obtainLocks(boolean active, boolean forWrite, int lockLevel, FetchConfiguration fetch, Object sdata) { if (!active) return; // if we haven't been locked yet, lock now at the given level int flag = (forWrite) ? FLAG_WRITE_LOCKED : FLAG_READ_LOCKED; if ((_flags & flag) == 0) { // make sure object is added to transaction so lock will get // cleared on commit/rollback if (lockLevel != LockLevels.LOCK_NONE) transactional(); if (fetch == null) fetch = _broker.getFetchConfiguration(); _broker.getLockManager().lock(this, lockLevel, fetch.getLockTimeout(), sdata); _flags |= FLAG_READ_LOCKED; _flags |= flag; } }
for (Iterator<StateManagerImpl> it = _pending.iterator(); it.hasNext();) { sm = (StateManagerImpl) it.next(); sm.transactional(); if (sm.isDirty()) setDirty(sm, true);
for (Iterator<StateManagerImpl> it = _pending.iterator(); it.hasNext();) { sm = (StateManagerImpl) it.next(); sm.transactional(); if (sm.isDirty()) setDirty(sm, true);
sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); sm.setCheckVersion(true);
sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); sm.setCheckVersion(true);
sm.transactional(); sm.load(_fc, StateManagerImpl.LOAD_FGS, null, null, false); sm.setCheckVersion(true);