in reply to Re^2: Storable - File empties itself?
in thread Storable - File empties itself?
If more than one process at a time may decide to rewrite the file you use for Storable data, you either need locks, or you need to delegate the problem (e.g. to a relational database).
For locking, see Re: Update config file parameters and flock. Note that locking can be messy if NFS is involved.
Often it is easier not to re-invent the wheel. Just don't use files at all, put your data into a relational database. File locking, concurrent reading and writing are solved problems for relational databases. You just need to connect to the database. That's what DBI is for.
Alexander
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Storable - File empties itself?
by feumw (Sexton) on Apr 14, 2023 at 07:14 UTC | |
by marto (Cardinal) on Apr 14, 2023 at 07:22 UTC | |
by afoken (Chancellor) on Apr 14, 2023 at 09:09 UTC | |
by Anonymous Monk on Apr 14, 2023 at 10:07 UTC | |
by feumw (Sexton) on Apr 18, 2023 at 06:36 UTC |