Keep It Simple, Stupid | |
PerlMonks |
Re: Atomic use of unlink() and SQL DELETE? How?by valdez (Monsignor) |
on Feb 10, 2006 at 12:17 UTC ( [id://529340]=note: print w/replies, xml ) | Need Help?? |
Why don't you first delete data from database and then from the filesystem? That's the way I implemented a similar unlink procedure; this way you use the rollback feature of your db and postpone the unlinking of the file until just after the commit. If the database operations fail, the file will not be touched; if the procedure can't unlink the file, the inconsistency could be repaired by a periodic sort of fsck. Am I wrong? Ciao, Valerio
In Section
Seekers of Perl Wisdom
|
|