/** * Return the base underlying native store manager. */ public StoreManager getInnermostDelegate() { return (_del == null) ? _store : _del.getInnermostDelegate(); }
/** * Begin a store manager transaction. */ private void beginStoreManagerTransaction(boolean optimistic) { if (!optimistic) { retainConnection(); _store.begin(); _flags |= FLAG_STORE_ACTIVE; } else { if (_connRetainMode == CONN_RETAIN_TRANS) retainConnection(); _store.beginOptimistic(); } }
releaseConn = _connRetainMode != CONN_RETAIN_ALWAYS; if (rollback) _store.rollback(); else _store.commit(); } else { releaseConn = _connRetainMode == CONN_RETAIN_TRANS; _store.rollbackOptimistic(); if (!rollback) { forcedRollback = true; try { _store.rollback(); } catch (RuntimeException re2) {}
/** * Used by Java EE Containers that wish to pool OpenJPA EntityManagers. The specification * doesn't allow the closing of connections with the clear() method. By introducing this * new method, we can do additional processing (and maybe more efficient processing) to * properly prepare an EM for pooling. * * @deprecated - use {@link clear()} instead. */ @Deprecated public void prepareForPooling() { assertNotCloseInvoked(); clear(); // Do not close connection if ConnectionRetainMode is set to Always... if (getConnectionRetainMode() != ConnectionRetainMode.ALWAYS) { _broker.lock(); // since this direct close path is not protected... try { _broker.getStoreManager().close(); } finally { _broker.unlock(); } } }
public void commit() { try { super.commit(); updateCaches(); } finally { _inserts = null; _updates = null; _deletes = null; } }
public void begin() { super.begin(); }
/** * Ask store manager to assign our oid, optionally flushing and * optionally recaching on the new oid. */ private boolean assignObjectId(boolean flush, boolean preFlushing) { if (_oid != null || isEmbedded() || !isPersistent()) return true; if (_broker.getStoreManager().assignObjectId(this, preFlushing)) { if (!preFlushing) assertObjectIdAssigned(true); } else if (flush) _broker.flush(); else return false; return true; }
public boolean cancelAll() { // this method does not lock, since we want to allow a different // thread to be able to cancel on a locked-up persistence manager assertOpen(); try { // if we're flushing, have to set rollback only -- do this before we // attempt to cancel, because otherwise the cancel might case the // transaction to complete before we have a chance to set the // rollback only flag if ((_flags & FLAG_STORE_FLUSHING) != 0) setRollbackOnlyInternal(new UserException()); return _store.cancelAll(); } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new StoreException(re); } }
try { _broker.getStoreManager().beforeStateChange(this, _state, state);
if (_broker.getStoreManager().assignField(this, field, preFlushing)) { fmd.setValueGenerated(true); return true;
|| broker.getStoreManager().compareVersion(sm, _version, origVersion) != StoreManager.VERSION_SAME)) { broker.transactional(sm.getManagedInstance(), false,
/** * Used by Java EE Containers that wish to pool OpenJPA EntityManagers. The specification * doesn't allow the closing of connections with the clear() method. By introducing this * new method, we can do additional processing (and maybe more efficient processing) to * properly prepare an EM for pooling. * * @deprecated - use {@link clear()} instead. */ @Deprecated public void prepareForPooling() { assertNotCloseInvoked(); clear(); // Do not close connection if ConnectionRetainMode is set to Always... if (getConnectionRetainMode() != ConnectionRetainMode.ALWAYS) { _broker.lock(); // since this direct close path is not protected... try { _broker.getStoreManager().close(); } finally { _broker.unlock(); } } }
public void commit() { try { super.commit(); updateCaches(); } finally { _inserts = null; _updates = null; _deletes = null; } }
public void begin() { super.begin(); }
/** * Ask store manager to assign our oid, optionally flushing and * optionally recaching on the new oid. */ boolean assignObjectId(boolean flush, boolean preFlushing) { if (_oid != null || isEmbedded() || !isPersistent()) return true; if (_broker.getStoreManager().assignObjectId(this, preFlushing)) { if (!preFlushing) assertObjectIdAssigned(true); } else if (flush) _broker.flush(); else return false; return true; }
public boolean cancelAll() { // this method does not lock, since we want to allow a different // thread to be able to cancel on a locked-up persistence manager assertOpen(); try { // if we're flushing, have to set rollback only -- do this before we // attempt to cancel, because otherwise the cancel might case the // transaction to complete before we have a chance to set the // rollback only flag if ((_flags & FLAG_STORE_FLUSHING) != 0) setRollbackOnlyInternal(new UserException()); return _store.cancelAll(); } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new StoreException(re); } }
try { _broker.getStoreManager().beforeStateChange(this, _state, state);
if (_broker.getStoreManager().assignField(this, field, preFlushing)) { fmd.setValueGenerated(true); return true;
|| broker.getStoreManager().compareVersion(sm, _version, origVersion) != StoreManager.VERSION_SAME)) { broker.transactional(sm.getManagedInstance(), false,
/** * Return the base underlying native store manager. */ public StoreManager getInnermostDelegate() { return (_del == null) ? _store : _del.getInnermostDelegate(); }