/** * Create a new StateManager instance based on the StateManager provided. A * new PersistenceCapable instance will be created and associated with the * new StateManager. All fields will be copied into the ne PC instance as * well as the dirty, loaded, and flushed bitsets. * * @param sm A statemanager instance which will effectively be cloned. */ public StateManagerImpl(StateManagerImpl sm) { this(sm, sm.getPCState()); }
/** * Create a new StateManager instance based on the StateManager provided. A * new PersistenceCapable instance will be created and associated with the * new StateManager. All fields will be copied into the ne PC instance as * well as the dirty, loaded, and flushed bitsets. * * @param sm A statemanager instance which will effectively be cloned. */ public StateManagerImpl(StateManagerImpl sm) { this(sm, sm.getPCState()); }
/** * Create a new StateManager instance based on the StateManager provided. A * new PersistenceCapable instance will be created and associated with the * new StateManager. All fields will be copied into the ne PC instance as * well as the dirty, loaded, and flushed bitsets. * * @param sm A statemanager instance which will effectively be cloned. */ public StateManagerImpl(StateManagerImpl sm) { this(sm, sm.getPCState()); }
/** * Create a new StateManager instance based on the StateManager provided. A * new PersistenceCapable instance will be created and associated with the * new StateManager. All fields will be copied into the ne PC instance as * well as the dirty, loaded, and flushed bitsets. * * @param sm A statemanager instance which will effectively be cloned. */ public StateManagerImpl(StateManagerImpl sm) { this(sm, sm.getPCState()); }
void audit() { if (_audits.isEmpty()) return; Collection<Audited> news = new HashSet<Audited>(); Collection<Audited> updates = new HashSet<Audited>(); Collection<Audited> deletes = new HashSet<Audited>(); for (Map.Entry<StateManagerImpl,PersistenceCapable> e : _audits.entrySet()) { StateManagerImpl sm = e.getKey(); Audited audited = new Audited(sm, e.getValue()); if (sm.getPCState().isNew()) { news.add(audited); } else if (sm.getPCState().isDeleted()) { deletes.add(audited); } else if (sm.getPCState().isDirty()) { updates.add(audited); } } try { _auditor.audit(_broker, news, updates, deletes); } catch (Exception e) { if (_auditor.isRollbackOnError()) { throw new RuntimeException("dump", e); } else { e.printStackTrace(); } } }
void audit() { if (_audits.isEmpty()) return; Collection<Audited> news = new HashSet<Audited>(); Collection<Audited> updates = new HashSet<Audited>(); Collection<Audited> deletes = new HashSet<Audited>(); for (Map.Entry<StateManagerImpl,PersistenceCapable> e : _audits.entrySet()) { StateManagerImpl sm = e.getKey(); Audited audited = new Audited(sm, e.getValue()); if (sm.getPCState().isNew()) { news.add(audited); } else if (sm.getPCState().isDeleted()) { deletes.add(audited); } else if (sm.getPCState().isDirty()) { updates.add(audited); } } try { _auditor.audit(_broker, news, updates, deletes); } catch (Exception e) { if (_auditor.isRollbackOnError()) { throw new RuntimeException("dump", e); } else { e.printStackTrace(); } } }
void audit() { if (_audits.isEmpty()) return; Collection<Audited> news = new HashSet<Audited>(); Collection<Audited> updates = new HashSet<Audited>(); Collection<Audited> deletes = new HashSet<Audited>(); for (Map.Entry<StateManagerImpl,PersistenceCapable> e : _audits.entrySet()) { StateManagerImpl sm = e.getKey(); Audited audited = new Audited(sm, e.getValue()); if (sm.getPCState().isNew()) { news.add(audited); } else if (sm.getPCState().isDeleted()) { deletes.add(audited); } else if (sm.getPCState().isDirty()) { updates.add(audited); } } try { _auditor.audit(_broker, news, updates, deletes); } catch (Exception e) { if (_auditor.isRollbackOnError()) { throw new RuntimeException("dump", e); } else { e.printStackTrace(); } } }
void audit() { if (_audits.isEmpty()) return; Collection<Audited> news = new HashSet<Audited>(); Collection<Audited> updates = new HashSet<Audited>(); Collection<Audited> deletes = new HashSet<Audited>(); for (Map.Entry<StateManagerImpl,PersistenceCapable> e : _audits.entrySet()) { StateManagerImpl sm = e.getKey(); Audited audited = new Audited(sm, e.getValue()); if (sm.getPCState().isNew()) { news.add(audited); } else if (sm.getPCState().isDeleted()) { deletes.add(audited); } else if (sm.getPCState().isDirty()) { updates.add(audited); } } try { _auditor.audit(_broker, news, updates, deletes); } catch (Exception e) { if (_auditor.isRollbackOnError()) { throw new RuntimeException("dump", e); } else { e.printStackTrace(); } } }
/** * Gets the type of this audit. */ public AuditableOperation getType() { PCState state = _sm.getPCState(); if (state.isNew()) return AuditableOperation.CREATE; if (state.isDeleted()) return AuditableOperation.DELETE; if (state.isDirty()) return AuditableOperation.UPDATE; return null; // should not happen } }
/** * Gets the type of this audit. */ public AuditableOperation getType() { PCState state = _sm.getPCState(); if (state.isNew()) return AuditableOperation.CREATE; if (state.isDeleted()) return AuditableOperation.DELETE; if (state.isDirty()) return AuditableOperation.UPDATE; return null; // should not happen } }
/** * Gets the type of this audit. */ public AuditableOperation getType() { PCState state = _sm.getPCState(); if (state.isNew()) return AuditableOperation.CREATE; if (state.isDeleted()) return AuditableOperation.DELETE; if (state.isDirty()) return AuditableOperation.UPDATE; return null; // should not happen } }
/** * Gets the type of this audit. */ public AuditableOperation getType() { PCState state = _sm.getPCState(); if (state.isNew()) return AuditableOperation.CREATE; if (state.isDeleted()) return AuditableOperation.DELETE; if (state.isDirty()) return AuditableOperation.UPDATE; return null; // should not happen } }
/** * Constructor. Provide instance to save and indicate whether * to copy persistent fields. Transactional fields will be * copied regardless of copy setting. */ public SavepointFieldManager(StateManagerImpl sm, boolean copy) { _sm = sm; _state = _sm.getPCState(); _dirty = (BitSet) _sm.getDirty().clone(); _flush = (BitSet) _sm.getFlushed().clone(); _loaded = (BitSet) _sm.getLoaded().clone(); FieldMetaData[] fields = _sm.getMetaData().getFields(); for (int i = 0; i < _loaded.length(); i++) { if (!_loaded.get(i)) continue; if (copy || fields[i].getManagement() == FieldMetaData.MANAGE_TRANSACTIONAL) { if (_copy == null) _copy = _sm.getPersistenceCapable().pcNewInstance (_sm, true); storeField(fields[i]); } else _loaded.clear(i); } // we need to proxy the fields so that we can track future changes // from this savepoint forward for PNew instances' mutable fields _sm.proxyFields(false, false); _version = _sm.getVersion (); _loadVersion = _sm.getLoadVersion (); }
/** * Constructor. Provide instance to save and indicate whether * to copy persistent fields. Transactional fields will be * copied regardless of copy setting. */ public SavepointFieldManager(StateManagerImpl sm, boolean copy) { _sm = sm; _state = _sm.getPCState(); _dirty = (BitSet) _sm.getDirty().clone(); _flush = (BitSet) _sm.getFlushed().clone(); _loaded = (BitSet) _sm.getLoaded().clone(); FieldMetaData[] fields = _sm.getMetaData().getFields(); for (int i = 0; i < _loaded.length(); i++) { if (!_loaded.get(i)) continue; if (copy || fields[i].getManagement() == FieldMetaData.MANAGE_TRANSACTIONAL) { if (_copy == null) _copy = _sm.getPersistenceCapable().pcNewInstance (_sm, true); storeField(fields[i]); } else _loaded.clear(i); } // we need to proxy the fields so that we can track future changes // from this savepoint forward for PNew instances' mutable fields _sm.proxyFields(false, false); _version = _sm.getVersion (); _loadVersion = _sm.getLoadVersion (); }
/** * Constructor. Provide instance to save and indicate whether * to copy persistent fields. Transactional fields will be * copied regardless of copy setting. */ public SavepointFieldManager(StateManagerImpl sm, boolean copy) { _sm = sm; _state = _sm.getPCState(); _dirty = (BitSet) _sm.getDirty().clone(); _flush = (BitSet) _sm.getFlushed().clone(); _loaded = (BitSet) _sm.getLoaded().clone(); FieldMetaData[] fields = _sm.getMetaData().getFields(); for (int i = 0; i < _loaded.length(); i++) { if (!_loaded.get(i)) continue; if (copy || fields[i].getManagement() == FieldMetaData.MANAGE_TRANSACTIONAL) { if (_copy == null) _copy = _sm.getPersistenceCapable().pcNewInstance (_sm, true); storeField(fields[i]); } else _loaded.clear(i); } // we need to proxy the fields so that we can track future changes // from this savepoint forward for PNew instances' mutable fields _sm.proxyFields(false, false); _version = _sm.getVersion (); _loadVersion = _sm.getLoadVersion (); }
/** * Constructor. Provide instance to save and indicate whether * to copy persistent fields. Transactional fields will be * copied regardless of copy setting. */ public SavepointFieldManager(StateManagerImpl sm, boolean copy) { _sm = sm; _state = _sm.getPCState(); _dirty = (BitSet) _sm.getDirty().clone(); _flush = (BitSet) _sm.getFlushed().clone(); _loaded = (BitSet) _sm.getLoaded().clone(); FieldMetaData[] fields = _sm.getMetaData().getFields(); for (int i = 0; i < _loaded.length(); i++) { if (!_loaded.get(i)) continue; if (copy || fields[i].getManagement() == FieldMetaData.MANAGE_TRANSACTIONAL) { if (_copy == null) _copy = _sm.getPersistenceCapable().pcNewInstance (_sm, true); storeField(fields[i]); } else _loaded.clear(i); } // we need to proxy the fields so that we can track future changes // from this savepoint forward for PNew instances' mutable fields _sm.proxyFields(false, false); _version = _sm.getVersion (); _loadVersion = _sm.getLoadVersion (); }
/** * Constructor. Provide instance to save and indicate whether * to copy persistent fields. Transactional fields will be * copied regardless of copy setting. */ public SavepointFieldManager(StateManagerImpl sm, boolean copy) { _sm = sm; _state = _sm.getPCState(); _dirty = (BitSet) _sm.getDirty().clone(); _flush = (BitSet) _sm.getFlushed().clone(); _loaded = (BitSet) _sm.getLoaded().clone(); FieldMetaData[] fields = _sm.getMetaData().getFields(); for (int i = 0; i < _loaded.length(); i++) { if (!_loaded.get(i)) continue; if (copy || fields[i].getManagement() == FieldMetaData.MANAGE_TRANSACTIONAL) { if (_copy == null) _copy = _sm.getPersistenceCapable().pcNewInstance (_sm, true); storeField(fields[i]); } else _loaded.clear(i); } // we need to proxy the fields so that we can track future changes // from this savepoint forward for PNew instances' mutable fields _sm.proxyFields(false, false); _version = _sm.getVersion (); _loadVersion = _sm.getLoadVersion (); }
if (sm.isPersistent()) { sms.add(sm); if (sm.getPCState() == PCState.HOLLOW) { if (load == null) load = new ArrayList<OpenJPAStateManager>();
assertActiveTransaction(); sms.add(sm); if (sm.getPCState() == PCState.HOLLOW) { if (load == null) load = new ArrayList<OpenJPAStateManager>();
assertActiveTransaction(); sms.add(sm); if (sm.getPCState() == PCState.HOLLOW) { if (load == null) load = new ArrayList<OpenJPAStateManager>();