Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Atomic use of unlink() and SQL DELETE? How?

by valdez (Monsignor)
on Feb 10, 2006 at 12:17 UTC ( #529340=note: print w/replies, xml ) Need Help??

in reply to Atomic use of unlink() and SQL DELETE? How?

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

  • Comment on Re: Atomic use of unlink() and SQL DELETE? How?

Replies are listed 'Best First'.
Re^2: Atomic use of unlink() and SQL DELETE? How?
by robins (Acolyte) on Jun 14, 2006 at 09:31 UTC
    This seems like the most appropriate solution for my application. I'll just have to build the cleanup process into the backend scheduler. Thanks for the tip (and sorry about the long delay in answering).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://529340]
[Spenser]: It's a stripped down version on a NAS device.
[Spenser]: It's frustrating
[Spenser]: Perl 5.10.0
[Spenser]: It uses opkg to install software
[choroba]: 5.10.1 would be much better
[shmem]: there are so many ways thinkable to fix that situation, some feasible and some not, that I'm unable to give good advice.
[Spenser]: I installed 5.22 with opkg. I can use it with cpan. I'm actually trying to install perl-DBD-mysql, but couldn't with it. So I went back to the factory version, 5.10.
[Spenser]: So, nevermind about CPAN. I give up on the downgraded angle. I'm back to fighting to install DBD.
[shmem]: please open a SoPW. At what point is the perl-DBD-mysql installation failing?

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-03-17 12:42 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (224 votes). Check out past polls.