public static MyRM.MyRM_Accessor MockRM(string dbname="test") { var db = new SimpleDatabase(dbname, true); db.CreateTable(Constants.ReservationTableName, 96, 36); db.CreateTable(Constants.ResourcesTableName, 96, 36); var tm = new MyTM.MyTM(); var rm = new MyRM_Accessor { _transactionStorage = new TransactionStorage(db), TransactionManager = tm, _name = dbname }; tm.Register(rm); return rm; }
private SimpleDatabase CreateDatabase() { var db = new SimpleDatabase("TEST_" + Guid.NewGuid(), useTwoPhaseCommit: true); db.CreateTable(Constants.ReservationTableName, 96, 36); db.CreateTable(Constants.ResourcesTableName, 96, 36); return db; }
protected void InitStorage() { var database = new SimpleDatabase("MYRM_" + _name, true); //TODO: BUGBUG: add validation to check the data and key length database.CreateTable(Constants.ReservationTableName, 96, 36); database.CreateTable(Constants.ResourcesTableName, 96, 36); _transactionStorage = new TransactionStorage(database); }