1 /**********************************************************
4 * create index if specified
5 * start transaction with READ_REPEATABLE isolation level
7 * check lock statistics
9 * check lock statistics
12 #include <DatabaseManagerImpl.h>
16 DbRetVal rv
= conn
.open("root", "manager");
17 if (rv
!= OK
) return 1;
18 DatabaseManagerImpl
*dbMgr
= (DatabaseManagerImpl
*) conn
.getDatabaseManager();
19 if (dbMgr
== NULL
) { printf("Auth failed\n"); return 2;}
21 if (createTable(dbMgr
, "t1") != 0 ) { ret
= 3; }
23 if (createIndex(dbMgr
, "t1","f1", "idx1") != 0 ) { ret
= 4; }
25 rv
= conn
.startTransaction();
26 if (rv
!= OK
) ret
= 5;
27 rc
= insertTuple(dbMgr
, conn
, "t1", 10);
28 if (rc
!= 10) ret
= 6;
31 rv
= conn
.startTransaction(READ_REPEATABLE
);
32 if (rv
!= OK
) ret
= 5;
33 rc
= deleteTuple(dbMgr
, conn
, "t1", 10);
34 if (rc
!= 10) ret
= 6;
35 printf("Before abort\n");
36 dbMgr
->printDebugLockInfo();
38 printf("After abort\n");
39 dbMgr
->printDebugLockInfo();
40 dropTable(dbMgr
, "t1");