protected Transaction beginTransaction() { return resumable ? env.beginTransaction(null, null) : null; }
public void setValue(String name, long value) { synchronized (mutex) { try { counterValues.put(name, value); if (statisticsDB != null) { Transaction txn = env.beginTransaction(null, null); statisticsDB.put(txn, new DatabaseEntry(name.getBytes()), new DatabaseEntry(Util.long2ByteArray(value))); txn.commit(); } } catch (RuntimeException e) { if (config.isHaltOnError()) { throw e; } else { logger.error("Exception setting value", e); } } } }
transaction = environment.beginTransaction(null, null);
transaction = environment.beginTransaction(null, null);
@Override public BerkeleyJETx beginTransaction(final BaseTransactionConfig txCfg) throws BackendException { try { Transaction tx = null; Configuration effectiveCfg = new MergedConfiguration(txCfg.getCustomOptions(), getStorageConfig()); if (transactional) { TransactionConfig txnConfig = new TransactionConfig(); ConfigOption.getEnumValue(effectiveCfg.get(ISOLATION_LEVEL),IsolationLevel.class).configure(txnConfig); tx = environment.beginTransaction(null, txnConfig); } BerkeleyJETx btx = new BerkeleyJETx(tx, ConfigOption.getEnumValue(effectiveCfg.get(LOCK_MODE),LockMode.class), txCfg); if (log.isTraceEnabled()) { log.trace("Berkeley tx created", new TransactionBegin(btx.toString())); } return btx; } catch (DatabaseException e) { throw new PermanentBackendException("Could not start BerkeleyJE transaction", e); } }
transaction = this.environment.beginTransaction(null, null);
transaction = this.environment.beginTransaction(null, null); DatabaseEntry keyEntry = new DatabaseEntry(key.get());
DatabaseEntry key = new DatabaseEntry(); DatabaseEntry value = new DatabaseEntry(); Transaction tnx = env.beginTransaction(null, null); Cursor cursor = statisticsDB.openCursor(tnx, null); result = cursor.getFirst(key, value, null);
public BimTransaction startTransaction() { if (useTransactions) { try { return new BerkeleyTransaction(environment.beginTransaction(null, transactionConfig)); } catch (DatabaseException e) { LOGGER.error("", e); } } return null; }
@Override public Object beginTransaction() { return env.beginTransaction(null, TransactionConfig.DEFAULT); }
@Override public Transaction beginTransaction(TransactionConfig transactionConfig) { return getEnvironment().beginTransaction(null, transactionConfig); }
@Override public BerkeleyJETx beginTransaction(final StoreTxConfig config) throws StorageException { try { Transaction tx = null; if (transactional) { tx = environment.beginTransaction(null, null); } return new BerkeleyJETx(tx, config); } catch (DatabaseException e) { throw new PermanentStorageException("Could not start BerkeleyJE transaction", e); } }
private void upgradeMessages(final Environment environment, final UpgradeInteractionHandler handler) { Transaction transaction = null; transaction = environment.beginTransaction(null, null); upgradeMessages(environment, handler, transaction); transaction.commit(); }
Tx beginTransaction() { Transaction transaction = environment.beginTransaction(null, null); Tx tx = new Tx(transaction); push(tx); return tx; }
public Void call() throws Exception { final Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null); try { createLayer(layerName, transaction); transaction.commit(); } catch (RuntimeException e) { transaction.abort(); } return null; } });
@BeforeMethod public void setUp() throws Exception { config = mock(EnvironmentConfig.class); when(config.getTransactional()).thenReturn(true); when(config.getLocking()).thenReturn(true); transaction = mock(Transaction.class); env = mock(Environment.class); when(env.getConfig()).thenReturn(config); when(env.beginTransaction(null, null)).thenReturn(transaction); worker = mock(TransactionWorker.class); }
public Void call() throws Exception { Transaction transaction = entityStore.getEnvironment().beginTransaction(null, null); try { call(transaction); transaction.commit(); } catch (RuntimeException e) { transaction.abort(); throw e; } return null; }
private Transaction getOrCreateTransaction() { final boolean transactional = objectDb.getConfig().getTransactional(); if (!transactional) { return null; } TransactionConfig config = new TransactionConfig(); config.setReadUncommitted(true); Transaction t = env.beginTransaction(null, config); return t; }
private void upgradeConfiguredObjectsAndDependencies(Environment environment, UpgradeInteractionHandler handler, String virtualHostName) { Transaction transaction = null; transaction = environment.beginTransaction(null, null); upgradeConfiguredObjects(environment, handler, transaction, virtualHostName); upgradeQueueEntries(environment, transaction, virtualHostName); upgradeXidEntries(environment, transaction, virtualHostName); transaction.commit(); }
@Test public void testMoreDeadlocks() throws Exception { Locker mockLocker = mock(Locker.class); doThrow(new LockTimeoutException(mockLocker, "")).when(worker).doWork(); when(env.beginTransaction(null, null)).thenReturn(transaction); runner = new PreparableTransactionRunner(env, 2, null); try { runner.prepare(worker); assert false : "should have gotten a deadlock exception"; } catch (LockTimeoutException e) { } }