Examples of Txn


Examples of com.sleepycat.je.txn.Txn

        boolean isDelDup = (delDupKey != null);
        LogEntryType entryType;
        long logAbortLsn;
        boolean logAbortKnownDeleted;
        Txn logTxn;
        LogContext context = new LogContext();

        if (locker != null && locker.isTransactional()) {
            entryType = isDelDup ?
                LogEntryType.LOG_DEL_DUPLN_TRANSACTIONAL :
View Full Code Here

Examples of com.sleepycat.je.txn.Txn

     * Used to get the Transaction object given an XA Xid.
     */
    public Transaction getXATransaction(Xid xid)
  throws DatabaseException {

  Txn ret = environmentImpl.getTxnManager().getTxnFromXid(xid);
  if (ret == null) {
      return null;
  }
  /* Do we guarantee object identity for Transaction objects? */
  return new Transaction(this, ret);
View Full Code Here

Examples of com.sleepycat.je.txn.Txn

                    abortKnownDeleted =
                        ((entryBuffer.get() & ABORT_KNOWN_DELETED_MASK) != 0) ?
                        true : false;

                    /* Locker */
                    txn = new Txn();
                    txn.readFromLog(entryBuffer, entryTypeVersion);
                }
            } else {

                /*
 
View Full Code Here

Examples of com.sleepycat.je.txn.Txn

        long prepareId = reader.getTxnPrepareId();
        Long prepareIdL = new Long(prepareId);
        if (!committedTxnIds.contains(prepareIdL) &&
      !abortedTxnIds.contains(prepareIdL)) {
      TransactionConfig txnConf = new TransactionConfig();
      Txn preparedTxn = new Txn(env, txnConf, prepareId);
      preparedTxn.setLockTimeout(0);
      preparedTxns.put(prepareIdL, preparedTxn);
      env.getTxnManager().registerXATxn
          (reader.getTxnPrepareXid(), preparedTxn, true);
      Tracer.trace(Level.INFO, env,
             "Found unfinished prepare record: id: " +
View Full Code Here

Examples of com.sleepycat.je.txn.Txn

                     * non-transactional LN, redo it.
                     */
        boolean processThisLN = false;
        boolean lnIsCommitted = false;
        boolean lnIsPrepared = false;
        Txn preparedTxn = null;
        if (txnId == null) {
      processThisLN = true;
        } else {
      lnIsCommitted = committedTxnIds.contains(txnId);
      if (!lnIsCommitted) {
          preparedTxn = (Txn) preparedTxns.get(txnId);
          lnIsPrepared = preparedTxn != null;
      }
      if (lnIsCommitted || lnIsPrepared) {
          processThisLN = true;
      }
        }
        if (processThisLN) {

                        /* Invoke the evictor to reduce memory consumption. */
                        env.invokeEvictor();

                        LN ln = reader.getLN();
                        DatabaseId dbId = reader.getDatabaseId();
                        DatabaseImpl db = dbMapTree.getDb(dbId);
                        long logLsn = reader.getLastLsn();
                        long treeLsn = DbLsn.NULL_LSN;

                        /* Database may be null if it's been deleted. */
                        if (db != null) {
                            ln.postFetchInit(db, logLsn);

          if (preparedTxn != null) {
        preparedTxn.addLogInfo(logLsn);

        /*
         * We're reconstructing a prepared, but not
         * finished, transaction.  We know that there
         * was a write lock on this LN since it exists
         * in the log under this txnId.
         */
        preparedTxn.lock
                                    (ln.getNodeId(), LockType.WRITE,
                                     false /*noWait*/, db);
        preparedTxn.setPrepared(true);
          }

                            treeLsn = redo(db,
                                           location,
                                           ln,
View Full Code Here

Examples of com.sleepycat.je.txn.Txn

             * back or one done on the behalf of a null txn.
             */
            LogEntryType entryType;
            long logAbortLsn;
            boolean logAbortKnownDeleted;
            Txn logTxn;
            if (locker.isTransactional()) {
                entryType = LogEntryType.LOG_DEL_DUPLN_TRANSACTIONAL;
    WriteLockInfo info = locker.getWriteLockInfo(getNodeId());
    logAbortLsn = info.getAbortLsn();
    logAbortKnownDeleted = info.getAbortKnownDeleted();
View Full Code Here

Examples of com.sleepycat.je.txn.Txn

        throws DatabaseException {

        LogEntryType entryType;
        long logAbortLsn;
  boolean logAbortKnownDeleted;
        Txn logTxn;
        if (locker != null && locker.isTransactional()) {
            entryType = getTransactionalLogType();
      WriteLockInfo info = locker.getWriteLockInfo(getNodeId());
      logAbortLsn = info.getAbortLsn();
      logAbortKnownDeleted = info.getAbortKnownDeleted();
View Full Code Here

Examples of org.apache.zookeeper.txn.Txn

                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
                    txn.serialize(boa, "request") ;
                    ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());

                    txns.add(new Txn(type, bb.array()));
                }

                request.setHdr(new TxnHeader(request.sessionId, request.cxid, zxid, zks.getTime(), request.type));
                request.setTxn(new MultiTxn(txns));
View Full Code Here

Examples of org.apache.zookeeper.txn.Txn

                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
                    request.txn.serialize(boa, "request") ;
                    ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());

                    txns.add(new Txn(request.hdr.getType(), bb.array()));
                    index++;
                }

                request.hdr = new TxnHeader(request.sessionId, request.cxid, zxid, zks.getTime(), request.type);
                request.txn = new MultiTxn(txns);
View Full Code Here

Examples of org.apache.zookeeper.txn.Txn

                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
                    request.txn.serialize(boa, "request") ;
                    ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());

                    txns.add(new Txn(request.hdr.getType(), bb.array()));
                    index++;
                }

                request.hdr = new TxnHeader(request.sessionId, request.cxid, zxid, zks.getTime(), request.type);
                request.txn = new MultiTxn(txns);
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.