P
popeye
Unregistered / Unconfirmed
GUEST, unregistred user!
server:unix open server+informix online
client:win98
BDE数据源:ODBC的informix driver,sqlthroughmode:not shared
database.starttransaction;
try
...
query1.add('insert into table ...');
query1.execsql;
...
query2.add('insert into table ...');
query2.execsql;
except
database.rollback;
end;
database.commit;
当query1.execsql执行成功后,query2由于参数错误execsql发生异常时
能够执行database.rollback,程序退出后查看数据库证明回滚成功.
当query1.execsql执行成功后,在query2.execsql之前showmessage('suspend')
暂停,然后拔掉网络线模拟网络故障,死机.结束程序后查看数据库发现
query1的插入生效.像这种情况如何能保证数据的完整性?
client:win98
BDE数据源:ODBC的informix driver,sqlthroughmode:not shared
database.starttransaction;
try
...
query1.add('insert into table ...');
query1.execsql;
...
query2.add('insert into table ...');
query2.execsql;
except
database.rollback;
end;
database.commit;
当query1.execsql执行成功后,query2由于参数错误execsql发生异常时
能够执行database.rollback,程序退出后查看数据库证明回滚成功.
当query1.execsql执行成功后,在query2.execsql之前showmessage('suspend')
暂停,然后拔掉网络线模拟网络故障,死机.结束程序后查看数据库发现
query1的插入生效.像这种情况如何能保证数据的完整性?