Пример #1
0
        internal PreparedTransaction[] txn_recover(uint count, uint flags)
        {
            int    err   = 0;
            IntPtr prepp = Marshal.AllocHGlobal((int)(count * (IntPtr.Size + DbConstants.DB_GID_SIZE)));
            uint   sz    = 0;

            err = txn_recover(prepp, count, ref sz, flags);
            DatabaseException.ThrowException(err);
            PreparedTransaction[] ret = new PreparedTransaction[sz];
            for (int i = 0; i < sz; i++)
            {
                IntPtr      cPtr = new IntPtr((IntPtr.Size == 4 ? prepp.ToInt32() : prepp.ToInt64()) + i * (IntPtr.Size + DbConstants.DB_GID_SIZE));
                DB_PREPLIST prep = new DB_PREPLIST(cPtr, false);
                ret[i] = new PreparedTransaction(prep);
            }
            Marshal.FreeHGlobal(prepp);
            return(ret);
        }
 internal PreparedTransaction(DB_PREPLIST prep)
 {
     trans = new Transaction(prep.txn);
     txnid = prep.gid;
 }
Пример #3
0
 internal PreparedTransaction[] txn_recover(int count, uint flags)
 {
     int err = 0;
     IntPtr prepp = Marshal.AllocHGlobal((int)(count * (IntPtr.Size + DbConstants.DB_GID_SIZE)));
     long sz = 0;
     err = txn_recover(prepp, count, ref sz, flags);
     DatabaseException.ThrowException(err);
     PreparedTransaction[] ret = new PreparedTransaction[sz];
     for (long i = 0; i < sz; i++) {
     IntPtr cPtr = new IntPtr((IntPtr.Size == 4 ? prepp.ToInt32() : prepp.ToInt64()) + i * (IntPtr.Size + DbConstants.DB_GID_SIZE));
     DB_PREPLIST prep = new DB_PREPLIST(cPtr, false);
     ret[i] = new PreparedTransaction(prep);
     }
     Marshal.FreeHGlobal(prepp);
     return ret;
 }
Пример #4
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DB_PREPLIST obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Пример #5
0
 internal static HandleRef getCPtr(DB_PREPLIST obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Пример #6
0
 internal static HandleRef getCPtr(DB_PREPLIST obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }