create table "LockTable" ( LockID integer primary key, LockTable varchar(255) NOT NULL, LockTime datetime NULL); insert into "LockTable" values (0, '', NULL); insert into "LockTable" values (1, 'MyTable', NULL); #### begin transaction; update "LockTable" set LockTime=CURRENT_TIMESTAMP where LockTable = 'MyTable'; insert into "MyTable" values (a, b, c, etc.); update "LockTable" set LockTime=NULL where LockTable = 'MyTable'; commit transaction;