/// <summary> /// Instantiate a new Sequence object. /// </summary> /// <remarks> /// If <paramref name="txn"/> is null and the operation occurs in a /// transactional database, the operation will be implicitly transaction /// protected. /// </remarks> /// <param name="cfg">Configuration parameters for the Sequence</param> /// <param name="txn"> /// If the operation is part of an application-specified transaction, /// <paramref name="txn"/> is a Transaction object returned from /// <see cref="DatabaseEnvironment.BeginTransaction"/>; if /// the operation is part of a Berkeley DB Concurrent Data Store group, /// <paramref name="txn"/> is a handle returned from /// <see cref="DatabaseEnvironment.BeginCDSGroup"/>; otherwise null. /// </param> public Sequence(SequenceConfig cfg, Transaction txn) { seq = new DB_SEQUENCE(cfg.BackingDatabase.db, 0); if (cfg.initialValIsSet) seq.initial_value(cfg.InitialValue); seq.set_flags(cfg.flags); if (cfg.rangeIsSet) seq.set_range(cfg.Min, cfg.Max); if (cfg.cacheSzIsSet) seq.set_cachesize(cfg.CacheSize); seq.open(Transaction.getDB_TXN(txn), cfg.key, cfg.openFlags); isOpen = true; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DB_SEQUENCE obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtr(DB_SEQUENCE obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtr(DB_SEQUENCE obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }