On Thu Dec 03 15:35:26 2009, DetlefPilzecker@web.de wrote:
Show quoted text> On Do. 03. Dez. 2009, 15:08:32, HMBRAND wrote:
> > Added f_lock support to DBD::File and committed to DBI.
> > Nothing more we can do from here.
>
> Do I understand it right, if I add "f_lock => 2" to the connect
> attributes, all files opened during the this process will be flocked
> until the program exists?
No - the files opened are locked until they are closed.
This typically happens when you finish the statement (e.g.
$sth->finish()) or the statement is implicitly finished (see DBI
documentation, when that happens).
Show quoted text> You still plan to write a LOCK TABLES/UNLOCK TABLES for version 2 ?
Yes, and many more - e.g. index-support, strong type binding and several
table types (for example to write a proxy table which is able to do a
sub-request to a PostgreSQL database).
Show quoted text> How long does the program wait (sleep) and try again to get a flock
> over an already flocked file by other instance of the program until it
> warns/exits?
Forever - unless you create an alarm(). Maybe Merijn could be persuaded
to implement flock($file, LOCK_EX | LOCK_NB ), too.