Package com.sleepycat.je

Examples of com.sleepycat.je.Transaction.commit()


            final DatabaseEntry key = new DatabaseEntry(keyData);
            final DatabaseEntry data = new DatabaseEntry(eventData);
            Transaction txn = environment.beginTransaction(null, null);
            try {
                database.put(txn, key, data);
                txn.commit();
                queue.add(keyData);
            } catch (Exception ex) {
                if (txn != null) {
                    txn.abort();
                }
View Full Code Here


                                            database.delete(txn, key);
                                        } catch (Exception ex) {
                                            LOGGER.error("Error deleting key from database", ex);
                                        }
                                    }
                                    txn.commit();
                                } catch (Exception ex) {
                                    LOGGER.error("Unable to commit transaction", ex);
                                    if (txn != null) {
                                        txn.abort();
                                    }
View Full Code Here

                                }
                                if (cursor != null) {
                                    cursor.close();
                                    cursor = null;
                                }
                                txn.commit();
                                txn = null;
                            } catch (Exception ex) {
                                LOGGER.error("Error reading or writing to database", ex);
                                shutdown = true;
                                break;
View Full Code Here

      Transaction txn = txnMap.remove(tx);
      if (txn != null) {
         if (trace) log.tracef("%s sleepycat transaction %s", commit ? "committing" : "aborting", txn);
         try {
            if (commit)
               txn.commit();
            else
               txn.abort();
         } catch (Exception caught) {
            throw convertToCacheLoaderException("Problem completing transaction", caught);
         }
View Full Code Here

            }
            success = true;
        } finally {
            cursor.close();
            if (success) {
                txn.commit();
            } else {
                txn.abort();
            }
        }
View Full Code Here

               "prepare() not allowed with a non-transactional cache loader");
      }
      Transaction txn = performTransaction(modifications);
      if (onePhase)
      {
         txn.commit();
      }
      else
      {
         txnMap.put(tx, txn);
      }
View Full Code Here

         throws Exception
   {

      if (!transactional) throw new IllegalStateException();
      Transaction txn = performTransaction(mods);
      txn.commit();
   }

   /**
    * Performs the given operation, starting a transaction and performing
    * retries.  Returns the transaction if successful; aborts the transaction
View Full Code Here

      checkNonNull(tx, "tx");

      Transaction txn = txnMap.remove(tx);
      if (txn != null)
      {
         txn.commit();
      }
      else if (transactional)
      {
         throw new IllegalArgumentException("Unknown txn key: " + tx);
      }
View Full Code Here

        RepGroupImpl group = groupBinding.entryToObject(groupEntry);

        group = fetchGroup(group.getName(),
                           DbInternal.getDatabaseImpl(db),
                           DbInternal.getTxn(txn));
        txn.commit();
        db.close();
        env.close();
        return group;
    }
View Full Code Here

                 * ReplicaWriteException invalidates the transaction, and there
                 * are no writes to commit anyway. [#16655]
                 */
                if (txn != null) {
                    if (success && !isReadOnly()) {
                        txn.commit();
                    } else {
                        txn.abort();
                    }
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.