On Wed, 22 Sep 2004, D. Richard Hipp wrote:

Ara.T.Howard wrote:
On Sat, 18 Sep 2004, Ara.T.Howard wrote:


say you have the following logic:


begin transaction in parent

 if pid = fork

   ....

   commit transaction

   close database

 else

   close database

   ...

 end



I do not know what will happen if you fork while holding an open
database connection.  Whatever does happen, I suppose it will not
be pretty.  SQLite is not designed to survive a fork.  Perhaps it
can be changed to work across a fork, but it will take some work.

thank you very much for the prompt reply. i was just starting work on a distributed helper object for my daemon - it would be responsible for forking processes and running children on the daemon's behalf - the tricky thing is obviously blocking to collect statuses - but it's manageable.

if you require help working to create a fork/execable api i would be glad to
assist.  i think it may be as easy as setting the close_on_exec flag on all
auxillary files use in a transaction.  perhaps simply giving access to the
list of auxillary files - and letting the developer handle the required call
would be safely though?

regards.

-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it. | --Dogen
===============================================================================

Reply via email to