[plt-scheme] Cleanup on servlet timeout

From: Henk Boom (lunarc.lists at gmail.com)
Date: Mon Jul 28 12:03:02 EDT 2008

On 2008-07-28, Henk Boom <lunarc.lists at gmail.com> wrote:
>  The second, however, is sqlite stuff, including freeing prepared
>  statements and aborting transactions (I'm using a modified version of
>  the sqlite bindings from PLaneT). These are kept on a per-response
>  basis, so I think it would be tricky to put them all in the resource
>  thread. Failing to do this stuff can make the database inaccessible
>  until I restart the server, so I really need to make it reliable. Any
>  ideas, or am I not giving enough information?

Actually, I could share the same database handle and transaction among
all threads. However, even then, if the last servlet thread is
terminated the cleanup will not be done. This isn't a problem with my
in-scheme synchronization above, since the next servlet thread to
start will get a new set of semaphores and such, but sqlite could be
left in a locked state. Even if I close the transaction from a will on
the database handle, that could leave it locked until the GC actually
happens.

I'm guessing this requires a different solution.

    Henk


Posted on the users mailing list.