Em 16/2/2012 05:26, nathanelrick escreveu: > Hello, > > i m in multi user database. > > I want to clean a table of all entries from one user (rec with field > id_user=xxx) and insert new entries, BUT i must be sure that noone is not > actually doing any insert on this table for this user. i can not lock the > table because this will affect all the users, i just need to lock all insert > with id_user=xxx > > is this possible in firebird ? > > at the end yes i will lock the table but if i can avoid it ... >
You could create a Table let's call it Locked_Users and insert the user name that is locked, commit it, and in a before isnert trigger on yur original trigger check if the user is locked and rais an exception. After you finished the cleaning, just removed the user name from the locked_users table. see you !
