in reply to Locking tables in Access database using Perl DBI

If there is no way to directly lock an Access file, then you could use a 'hack' and flock some temp file instead:

User A comes along and attempts to delete some records, your code first checks to see if the temp file has been locked. If not, lock it - delete - unlock. If user B tries to access the database while user A's request for deletion is still being processed, user B will have to wait until the lock is freed. Of course, this still might not address the needed delay between deleting and selecting.

I presume that you have to use Access? If you really don't, you might want to look at DBD::SQLite as a better replacement.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
  • Comment on (jeffa) Re: Locking tables in Access database using Perl DBI

Replies are listed 'Best First'.
Re: Re: Locking tables in Access database using Perl DBI
by relax99 (Monk) on Dec 03, 2002 at 20:33 UTC

    I also think this would not address the delay between deleting and selecting.

    I wonder how one does table/record locking with industrial strength databases like SQL Server or Oracle using Perl and DBI. I really didn't find anything in the DBI documentation that addresses locking issues.