Пример #1
0
internal int set_commit_token(DB_TXN_TOKEN token)
{
    int ret;
    ret = libdb_csharpPINVOKE.DB_TXN_set_commit_token(swigCPtr, DB_TXN_TOKEN.getCPtr(token));
    DatabaseException.ThrowException(ret);
    return ret;
}
Пример #2
0
        internal int set_commit_token(DB_TXN_TOKEN token)
        {
            int ret;

            ret = libdb_csharpPINVOKE.DB_TXN_set_commit_token(swigCPtr, DB_TXN_TOKEN.getCPtr(token));
            DatabaseException.ThrowException(ret);
            return(ret);
        }
Пример #3
0
 internal int is_transaction_applied(DB_TXN_TOKEN token, uint timeout, uint flags)
 {
     return libdb_csharpPINVOKE.DB_ENV_is_transaction_applied(swigCPtr, DB_TXN_TOKEN.getCPtr(token), timeout, flags);
 }
Пример #4
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DB_TXN_TOKEN obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Пример #5
0
 /// <summary>
 /// This method checks to see if a specified transaction has been replicated from 
 /// the master of a replication group. It may be called by applications using either
 /// the Base API or the Replication Manager.
 /// </summary>
 /// <param name="token">
 /// The commit token from a transaction previously written at a master
 /// site in the replication group.  Commit tokens are retrieved using
 /// the <see cref="Transaction.CommitToken"/> method.
 /// </param>
 /// <param name="timeout">
 /// The maximum time to wait for the transaction to arrive by replication, expressed in 
 /// microseconds.  To check the status of the transaction without waiting, the timeout 
 /// may be specified as 0.
 /// </param>
 /// <returns>
 /// This method returns TransactionAppliedStatus.APPLIED to indicate that the specified 
 /// transaction has indeed been applied at the local site. TransactionAppliedStatus.TIMEOUT
 /// returns if the specified transaction has not yet arrived at the calling site, 
 /// but can be expected to arrive soon. TransactionAppliedStatus.NOTFOUND is returned 
 /// if the transaction has not been applied at the local site, and it can be determined that
 /// the transaction has been rolled back due to a master takeover, and is therefore never 
 /// expected to arrive. TransactionAppliedStatus.EMPTY_TRANSACTION returns if the specified
 /// token was generated by a transaction that did not modify the database environment 
 /// (e.g., a read-only transaction).
 /// </returns>
 public TransactionAppliedStatus IsTransactionApplied(byte[] token, uint timeout)
 {
     if (token == null)
         throw new ArgumentNullException("The token cannot be null.");
     if (token.Length != DbConstants.DB_TXN_TOKEN_SIZE)
     {
         throw new ArgumentOutOfRangeException("The token size must be "
             + DbConstants.DB_TXN_TOKEN_SIZE);
     }
     DB_TXN_TOKEN txn_token = new DB_TXN_TOKEN(token);
     int ret = dbenv.is_transaction_applied(txn_token, timeout, 0);
     switch (ret)
     {
         case 0:
             return TransactionAppliedStatus.APPLIED;
         case DbConstants.DB_TIMEOUT:
             return TransactionAppliedStatus.TIMEOUT;
         case DbConstants.DB_NOTFOUND:
             return TransactionAppliedStatus.NOTFOUND;
         case DbConstants.DB_KEYEMPTY:
             return TransactionAppliedStatus.EMPTY_TRANSACTION;
         default:
             throw new DatabaseException(ret);
     }
 }
Пример #6
0
 internal Transaction(DB_TXN txn)
 {
     dbtxn = txn;
     dbtoken = null;
 }
Пример #7
0
 internal void SetCommitToken()
 {
     if (dbtxn.is_commit_token_enabled()) {
         dbtoken = new DB_TXN_TOKEN();
         dbtxn.set_commit_token(dbtoken);
     }
 }
Пример #8
0
 internal static HandleRef getCPtr(DB_TXN_TOKEN obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Пример #9
0
 internal static HandleRef getCPtr(DB_TXN_TOKEN obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Пример #10
0
 internal int is_transaction_applied(DB_TXN_TOKEN token, uint timeout, uint flags)
 {
     return(libdb_csharpPINVOKE.DB_ENV_is_transaction_applied(swigCPtr, DB_TXN_TOKEN.getCPtr(token), timeout, flags));
 }