# transaction read write serializableset transaction rollback updates
# commitあるいはrollbackの動作確認をする。
# 各々のスクリプトごとに各種の論理ファイルを試す。
Begin;
BeginTimeSpan;
Initialize;
EndTimeSpan;
InitializeSession "DefaultDB";

Command  "create table T1(C1 ntext array [no limit])";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'inverted=(nolocation=true, notf=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'inverted=(nolocation=true, notf=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'sectionized ,inverted=(nolocation=true, notf=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'sectionized ,inverted=(nolocation=true, notf=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'delayed ,inverted=(nolocation=true, notf=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'delayed ,inverted=(nolocation=true, notf=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit])";
Command  "create fulltext index I1_1 on T1(C1) hint 'inverted=(nolocation=true, notf=true, normalized=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "drop table T1";

Command  "create table T1(C1 ntext array [no limit] hint heap)";
Command  "create fulltext index I1_1 on T1(C1) hint 'inverted=(nolocation=true, notf=true, normalized=true)'";
# 一度のtransactionで複数のタプルを操作する
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "commit";
# insert->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\Teihon.txt"]];
Command  "insert into T1 (C1) values (?)" [[textsjisfile "..\\..\\doc\\takekurabe.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# update->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\Teihon.txt"], [textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "update T1 set C1=? where C1=?" [[textsjisfile "..\\..\\doc\\takekurabe.txt"], [textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

# delete->rollbackの動作確認
Command  "set transaction read write, isolation level serializable";
Command  "start transaction read write";
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\hello.txt"]];
Command  "delete from T1 where C1=?" [[textsjisfile "..\\..\\doc\\ricoh.txt"]];
Command  "select * from T1";
Command  "rollback";
Command  "select * from T1";

Command  "select * from T1";
#Command  "drop table T1";

TerminateSession "DefaultDB";
# (障害回復を試すためTerminateしない)
End;
