/** * Check that we are in a state to be able to perform a bulk operation; * also flush the current modfications if any elements are currently dirty. */ private void assertBulkModify(StoreQuery q, StoreQuery.Executor ex, Object[] params) { _broker.assertActiveTransaction(); if (_startIdx != 0 || _endIdx != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); if (_resultClass != null) throw new UserException(_loc.get("no-modify-resultclass")); StoreQuery.Range range = new StoreQuery.Range(); ex.getRange(q, params, range); if (range.start != 0 || range.end != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); }
/** * Check that we are in a state to be able to perform a bulk operation; * also flush the current modfications if any elements are currently dirty. */ private void assertBulkModify(StoreQuery q, StoreQuery.Executor ex, Object[] params) { _broker.assertActiveTransaction(); if (_startIdx != 0 || _endIdx != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); if (_resultClass != null) throw new UserException(_loc.get("no-modify-resultclass")); StoreQuery.Range range = new StoreQuery.Range(); ex.getRange(q, params, range); if (range.start != 0 || range.end != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); }
/** * Check that we are in a state to be able to perform a bulk operation; * also flush the current modfications if any elements are currently dirty. */ private void assertBulkModify(StoreQuery q, StoreQuery.Executor ex, Object[] params) { _broker.assertActiveTransaction(); if (_startIdx != 0 || _endIdx != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); if (_resultClass != null) throw new UserException(_loc.get("no-modify-resultclass")); StoreQuery.Range range = new StoreQuery.Range(); ex.getRange(q, params, range); if (range.start != 0 || range.end != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); }
/** * Check that we are in a state to be able to perform a bulk operation; * also flush the current modfications if any elements are currently dirty. */ private void assertBulkModify(StoreQuery q, StoreQuery.Executor ex, Object[] params) { _broker.assertActiveTransaction(); if (_startIdx != 0 || _endIdx != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); if (_resultClass != null) throw new UserException(_loc.get("no-modify-resultclass")); StoreQuery.Range range = new StoreQuery.Range(); ex.getRange(q, params, range); if (range.start != 0 || range.end != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); }
/** * Check that we are in a state to be able to perform a bulk operation; * also flush the current modfications if any elements are currently dirty. */ private void assertBulkModify(StoreQuery q, StoreQuery.Executor ex, Object[] params) { _broker.assertActiveTransaction(); if (_startIdx != 0 || _endIdx != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); if (_resultClass != null) throw new UserException(_loc.get("no-modify-resultclass")); StoreQuery.Range range = new StoreQuery.Range(); ex.getRange(q, params, range); if (range.start != 0 || range.end != Long.MAX_VALUE) throw new UserException(_loc.get("no-modify-range")); }
public void lock(Object obj, int level, int timeout, OpCallbacks call) { if (obj == null) return; beginOperation(true); try { assertActiveTransaction(); StateManagerImpl sm = getStateManagerImpl(obj, true); if ((processArgument(OpCallbacks.OP_LOCK, obj, sm, call) & OpCallbacks.ACT_RUN) == 0) return; if (sm == null || !sm.isPersistent()) return; _lm.lock(sm, level, timeout, null); sm.readLocked(level, level); // use same level for future write } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new GeneralException(re); } finally { endOperation(); } }
public void lock(Object obj, int level, int timeout, OpCallbacks call) { if (obj == null) return; beginOperation(true); try { assertActiveTransaction(); StateManagerImpl sm = getStateManagerImpl(obj, true); if ((processArgument(OpCallbacks.OP_LOCK, obj, sm, call) & OpCallbacks.ACT_RUN) == 0) return; if (sm == null || !sm.isPersistent()) return; _lm.lock(sm, level, timeout, null); sm.readLocked(level, level); // use same level for future write } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new GeneralException(re); } finally { endOperation(); } }
public void lock(Object obj, int level, int timeout, OpCallbacks call) { if (obj == null) return; beginOperation(true); try { assertActiveTransaction(); StateManagerImpl sm = getStateManagerImpl(obj, true); if ((processArgument(OpCallbacks.OP_LOCK, obj, sm, call) & OpCallbacks.ACT_RUN) == 0) return; if (sm == null || !sm.isPersistent()) return; _lm.lock(sm, level, timeout, null); sm.readLocked(level, level); // use same level for future write } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new GeneralException(re); } finally { endOperation(); } }
public void lock(Object obj, int level, int timeout, OpCallbacks call) { if (obj == null) return; beginOperation(true); try { assertActiveTransaction(); StateManagerImpl sm = getStateManagerImpl(obj, true); if ((processArgument(OpCallbacks.OP_LOCK, obj, sm, call) & OpCallbacks.ACT_RUN) == 0) return; if (sm == null || !sm.isPersistent()) return; _lm.lock(sm, level, timeout, null); sm.readLocked(level, level); // use same level for future write } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new GeneralException(re); } finally { endOperation(); } }
public void lock(Object obj, int level, int timeout, OpCallbacks call) { if (obj == null) return; beginOperation(true); try { assertActiveTransaction(); StateManagerImpl sm = getStateManagerImpl(obj, true); if ((processArgument(OpCallbacks.OP_LOCK, obj, sm, call) & OpCallbacks.ACT_RUN) == 0) return; if (sm == null || !sm.isPersistent()) return; _lm.lock(sm, level, timeout, null); sm.readLocked(level, level); // use same level for future write } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new GeneralException(re); } finally { endOperation(); } }
public void releaseSavepoint(String savepoint) { beginOperation(false); try { assertActiveTransaction(); int index = (_savepoints == null) ? -1 : _savepoints.indexOf(savepoint); if (index < 0) throw new UserException(_loc.get("no-savepoint", savepoint)); // clear old in reverse OpenJPASavepoint save; while (_savepoints.size() > index + 1) { save = (OpenJPASavepoint) _savepoints.remove (_savepoints.size() - 1); save.release(false); } save = (OpenJPASavepoint) _savepoints.remove(index); save.release(true); if (_savepointCache != null) _savepointCache.clear(); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void releaseSavepoint(String savepoint) { beginOperation(false); try { assertActiveTransaction(); int index = (_savepoints == null) ? -1 : _savepoints.indexOf(savepoint); if (index < 0) throw new UserException(_loc.get("no-savepoint", savepoint)); // clear old in reverse OpenJPASavepoint save; while (_savepoints.size() > index + 1) { save = (OpenJPASavepoint) _savepoints.remove (_savepoints.size() - 1); save.release(false); } save = (OpenJPASavepoint) _savepoints.remove(index); save.release(true); if (_savepointCache != null) _savepointCache.clear(); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void releaseSavepoint(String savepoint) { beginOperation(false); try { assertActiveTransaction(); int index = (_savepoints == null) ? -1 : _savepoints.indexOf(savepoint); if (index < 0) throw new UserException(_loc.get("no-savepoint", savepoint)); // clear old in reverse OpenJPASavepoint save; while (_savepoints.size() > index + 1) { save = (OpenJPASavepoint) _savepoints.remove (_savepoints.size() - 1); save.release(false); } save = (OpenJPASavepoint) _savepoints.remove(index); save.release(true); if (_savepointCache != null) _savepointCache.clear(); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void releaseSavepoint(String savepoint) { beginOperation(false); try { assertActiveTransaction(); int index = (_savepoints == null) ? -1 : _savepoints.indexOf(savepoint); if (index < 0) throw new UserException(_loc.get("no-savepoint", savepoint)); // clear old in reverse OpenJPASavepoint save; while (_savepoints.size() > index + 1) { save = (OpenJPASavepoint) _savepoints.remove (_savepoints.size() - 1); save.release(false); } save = (OpenJPASavepoint) _savepoints.remove(index); save.release(true); if (_savepointCache != null) _savepointCache.clear(); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void releaseSavepoint(String savepoint) { beginOperation(false); try { assertActiveTransaction(); int index = (_savepoints == null) ? -1 : _savepoints.indexOf(savepoint); if (index < 0) throw new UserException(_loc.get("no-savepoint", savepoint)); // clear old in reverse OpenJPASavepoint save; while (_savepoints.size() > index + 1) { save = (OpenJPASavepoint) _savepoints.remove (_savepoints.size() - 1); save.release(false); } save = (OpenJPASavepoint) _savepoints.remove(index); save.release(true); if (_savepointCache != null) _savepointCache.clear(); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void setSavepoint(String name) { beginOperation(true); try { assertActiveTransaction(); if (_savepoints != null && _savepoints.containsKey(name)) throw new UserException(_loc.get("savepoint-exists", name)); if (hasFlushed() && !_spm.supportsIncrementalFlush()) throw new UnsupportedException(_loc.get ("savepoint-flush-not-supported")); OpenJPASavepoint save = _spm.newSavepoint(name, this); if (_savepoints == null || _savepoints.isEmpty()) { save.save(getTransactionalStates()); _savepoints = new LinkedMap(); } else { if (_savepointCache == null) save.save(Collections.EMPTY_LIST); else { save.save(_savepointCache); _savepointCache.clear(); } } _savepoints.put(name, save); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void setSavepoint(String name) { beginOperation(true); try { assertActiveTransaction(); if (_savepoints != null && _savepoints.containsKey(name)) throw new UserException(_loc.get("savepoint-exists", name)); if (hasFlushed() && !_spm.supportsIncrementalFlush()) throw new UnsupportedException(_loc.get ("savepoint-flush-not-supported")); OpenJPASavepoint save = _spm.newSavepoint(name, this); if (_savepoints == null || _savepoints.isEmpty()) { save.save(getTransactionalStates()); _savepoints = new LinkedMap(); } else { if (_savepointCache == null) save.save(Collections.EMPTY_SET); else { save.save(_savepointCache); _savepointCache.clear(); } } _savepoints.put(name, save); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void setSavepoint(String name) { beginOperation(true); try { assertActiveTransaction(); if (_savepoints != null && _savepoints.containsKey(name)) throw new UserException(_loc.get("savepoint-exists", name)); if (hasFlushed() && !_spm.supportsIncrementalFlush()) throw new UnsupportedException(_loc.get ("savepoint-flush-not-supported")); OpenJPASavepoint save = _spm.newSavepoint(name, this); if (_savepoints == null || _savepoints.isEmpty()) { save.save(getTransactionalStates()); _savepoints = new LinkedMap(); } else { if (_savepointCache == null) save.save(Collections.EMPTY_SET); else { save.save(_savepointCache); _savepointCache.clear(); } } _savepoints.put(name, save); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void setSavepoint(String name) { beginOperation(true); try { assertActiveTransaction(); if (_savepoints != null && _savepoints.containsKey(name)) throw new UserException(_loc.get("savepoint-exists", name)); if (hasFlushed() && !_spm.supportsIncrementalFlush()) throw new UnsupportedException(_loc.get ("savepoint-flush-not-supported")); OpenJPASavepoint save = _spm.newSavepoint(name, this); if (_savepoints == null || _savepoints.isEmpty()) { save.save(getTransactionalStates()); _savepoints = new LinkedMap(); } else { if (_savepointCache == null) save.save(Collections.EMPTY_SET); else { save.save(_savepointCache); _savepointCache.clear(); } } _savepoints.put(name, save); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public void setSavepoint(String name) { beginOperation(true); try { assertActiveTransaction(); if (_savepoints != null && _savepoints.containsKey(name)) throw new UserException(_loc.get("savepoint-exists", name)); if (hasFlushed() && !_spm.supportsIncrementalFlush()) throw new UnsupportedException(_loc.get ("savepoint-flush-not-supported")); OpenJPASavepoint save = _spm.newSavepoint(name, this); if (_savepoints == null || _savepoints.isEmpty()) { save.save(getTransactionalStates()); _savepoints = new LinkedMap(); } else { if (_savepointCache == null) save.save(Collections.EMPTY_SET); else { save.save(_savepointCache); _savepointCache.clear(); } } _savepoints.put(name, save); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }