/// <summary> /// Create a new database object with the same underlying DB handle as /// <paramref name="clone"/>. Used during Database.Open to get an /// object of the correct DBTYPE. /// </summary> /// <param name="clone">Database to clone</param> protected BaseDatabase(BaseDatabase clone) { db = clone.db; clone.db = null; db.api_internal = this; env = clone.env; clone.env = null; }
/// <summary> /// Create a new database object with the same underlying DB handle as /// <paramref name="clone"/>. Used during Database.Open to get an /// object of the correct DBTYPE. /// </summary> /// <param name="clone">Database to clone</param> protected Database(BaseDatabase clone) : base(clone) { }
internal HeapDatabase(BaseDatabase clone) : base(clone) { }
internal RecnoDatabase(BaseDatabase clone) : base(clone) { }
internal BTreeDatabase(BaseDatabase clone) : base(clone) { }
/// <summary> /// Rename the database specified by <paramref name="Filename"/> and /// <paramref name="DatabaseName"/>. /// </summary> /// <overloads> /// <para> /// Applications should not rename databases that are currently in use. /// If an underlying file is being renamed and logging is currently /// enabled in the database environment, no database in the file may be /// open when Rename is called. In particular, some architectures do not /// permit renaming files with open handles. On these architectures, /// attempts to rename databases that are currently in use by any thread /// of control in the system may fail. /// </para> /// <para> /// Rename should not be called if the rename is intended to be /// transactionally safe; /// <see cref="DatabaseEnvironment.RenameDB"/> should be /// used instead. /// </para> /// </overloads> /// <param name="Filename">The file to rename</param> /// <param name="DatabaseName">The database to rename</param> /// <param name="NewName">The new database name</param> /// <param name="DbEnv"> /// The DatabaseEnvironment the database belongs to /// </param> public static void Rename(string Filename, string DatabaseName, string NewName, DatabaseEnvironment DbEnv) { BaseDatabase db = new BaseDatabase(DbEnv, 0); db.db.rename(Filename, DatabaseName, NewName, 0); }
/// <summary> /// Protected factory method to create and open a new database object. /// </summary> /// <param name="Filename">The database's filename</param> /// <param name="DatabaseName">The subdatabase's name</param> /// <param name="cfg">The database's configuration</param> /// <param name="txn"> /// The transaction in which to open the database /// </param> /// <returns>A new, open database object</returns> protected static BaseDatabase Open(string Filename, string DatabaseName, DatabaseConfig cfg, Transaction txn) { BaseDatabase ret = new BaseDatabase(cfg.Env, 0); ret.Config(cfg); ret.db.open(Transaction.getDB_TXN(txn), Filename, DatabaseName, DBTYPE.DB_UNKNOWN, cfg.openFlags, 0); return ret; }
internal HashDatabase(BaseDatabase clone) : base(clone) { }
internal QueueDatabase(BaseDatabase clone) : base(clone) { }