From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- .../com/amazon/carbonado/txn/TransactionPair.html | 502 +++++++++++++++++++++ 1 file changed, 502 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/txn/TransactionPair.html (limited to 'apidocs/com/amazon/carbonado/txn/TransactionPair.html') diff --git a/apidocs/com/amazon/carbonado/txn/TransactionPair.html b/apidocs/com/amazon/carbonado/txn/TransactionPair.html new file mode 100644 index 0000000..37080e6 --- /dev/null +++ b/apidocs/com/amazon/carbonado/txn/TransactionPair.html @@ -0,0 +1,502 @@ + + + + + + +TransactionPair (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.txn
+

Class TransactionPair

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Transaction
    +
    +
    +
    +
    public class TransactionPair
    +extends java.lang.Object
    +implements Transaction
    +
    Pairs two transaction together into one. The transaction cannot be atomic, + however. Inconsistencies can result if the primary transaction succeeds in + committing, but the secondary fails. Therefore, the designated primary + transaction should be the one that is more likely to fail. For example, the + primary transaction might rely on the network, but the secondary operates + locally.
    +
    Author:
    +
    Don Schneider, Brian S O'Neill
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      voidattach() +
      Attaches this transaction to the current thread, if it has been + detached.
      +
      voidcommit() +
      If currently in a transaction, commits all changes to the storage layer + since the last commit within the transaction.
      +
      voiddetach() +
      Detaches this transaction from the current thread.
      +
      voidexit() +
      Closes the current transaction, aborting all changes since the last + commit.
      +
      IsolationLevelgetIsolationLevel() +
      Returns the isolation level of this transaction.
      +
      booleanisForUpdate() +
      Returns true if this transaction is in update mode, which is adjusted by + calling Transaction.setForUpdate(boolean).
      +
      booleanpreCommit() +
      Calling this method commits all nested child transactions, closes all + scoped cursors, and locks out some interactions from other threads.
      +
      voidsetDesiredLockTimeout(int timeout, + java.util.concurrent.TimeUnit unit) +
      Specify a desired timeout for aquiring locks within this + transaction.
      +
      voidsetForUpdate(boolean forUpdate) +
      Set to true to force all read operations within this transaction to + acquire upgradable or write locks.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TransactionPair

        +
        public TransactionPair(Transaction primaryTransaction,
        +               Transaction secondaryTransaction)
        +
        Parameters:
        primaryTransaction - is committed first, exited last
        secondaryTransaction - is exited first, commited last
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        commit

        +
        public void commit()
        +            throws PersistException
        +
        Description copied from interface: Transaction
        +
        If currently in a transaction, commits all changes to the storage layer + since the last commit within the transaction.
        +
        +
        Specified by:
        +
        commit in interface Transaction
        +
        Throws:
        +
        PersistException - if storage layer throws an exception
        +
      • +
      + + + +
        +
      • +

        exit

        +
        public void exit()
        +          throws PersistException
        +
        Description copied from interface: Transaction
        +
        Closes the current transaction, aborting all changes since the last + commit.
        +
        +
        Specified by:
        +
        exit in interface Transaction
        +
        Throws:
        +
        PersistException - if storage layer throws an exception
        +
      • +
      + + + +
        +
      • +

        setForUpdate

        +
        public void setForUpdate(boolean forUpdate)
        +
        Description copied from interface: Transaction
        +
        Set to true to force all read operations within this transaction to + acquire upgradable or write locks. This option eliminates deadlocks that + may occur when updating records, except it may increase contention.
        +
        +
        Specified by:
        +
        setForUpdate in interface Transaction
        +
        +
      • +
      + + + + + + + +
        +
      • +

        setDesiredLockTimeout

        +
        public void setDesiredLockTimeout(int timeout,
        +                         java.util.concurrent.TimeUnit unit)
        +
        Description copied from interface: Transaction
        +
        Specify a desired timeout for aquiring locks within this + transaction. Calling this method may have have no effect at all, if the + repository does not support this feature. In addition, the lock timeout + might not be alterable if the transaction contains uncommitted data. + +

        Also, the range of lock timeout values supported might be small. For + example, only a timeout value of zero might be supported. In that case, + the transaction is configured to not wait at all when trying to acquire + locks. Expect immediate timeout exceptions when locks cannot be + granted. + +

        Nested transactions inherit the desired lock timeout of their + parent. Top transactions always begin with the default lock timeout.

        +
        +
        Specified by:
        +
        setDesiredLockTimeout in interface Transaction
        +
        Parameters:
        timeout - Desired lock timeout. If negative, revert lock timeout to + default value.
        unit - Time unit for timeout. If null, revert lock timeout to + default value.
        +
      • +
      + + + + + + + +
        +
      • +

        detach

        +
        public void detach()
        +
        Description copied from interface: Transaction
        +
        Detaches this transaction from the current thread. It can be attached + later, and to any thread which currently has no thread-local + transaction. + +

        Detaching a transaction also detaches any parent and nested child + transactions. Attaching any of them achieves the same result as + attaching this transaction.

        +
        +
        Specified by:
        +
        detach in interface Transaction
        +
        +
      • +
      + + + +
        +
      • +

        attach

        +
        public void attach()
        +
        Description copied from interface: Transaction
        +
        Attaches this transaction to the current thread, if it has been + detached. Attaching a transaction also attaches any parent and nested + child transactions.
        +
        +
        Specified by:
        +
        attach in interface Transaction
        +
        +
      • +
      + + + +
        +
      • +

        preCommit

        +
        public boolean preCommit()
        +                  throws PersistException
        +
        Description copied from interface: Transaction
        +
        Calling this method commits all nested child transactions, closes all + scoped cursors, and locks out some interactions from other threads. The + commit method must still be called to finish the commit. Most applications + have no use for pre-commit and should only ever call commit. + +

        The intent of this method is to complete as many operations as + possible leading up to the actual commit. If pre-commit succeeds, then + commit will most likely succeed as well. While in a pre-commit state, the + transaction can still be used by the current thread. Calling pre-commit + again ensures that child transactions and cursors are closed.

        +
        +
        Specified by:
        +
        preCommit in interface Transaction
        +
        Returns:
        false if transaction has exited
        +
        Throws:
        +
        PersistException
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3