We have to scenarios:

- A "sudo" like functionality
- Background processes

In the sudo case, we make sure thread locals can't leak from one user to 
the other. We also have a couple of Spring beans which are "user" scoped.

The background process starts a thread, waits for a few moments. If the 
thread returns in that time, the results are processed immediately. The 
most common case here is an error. But if the thread doesn't return 
quickly, we need to save the current state and prepare everything that the 
thread can later save its results and the UI can tell the user that a 
background job is working for them.

In both cases, the new threads and the foreground connection usually don't 
access the same objects. But if it happens, then we get deadlocks.

I was also looking into a way to have Spring pass the current connection to 
the new thread (since the parent thread is always waiting) but I can't 
figure out how.

Regards,

On Tuesday, January 27, 2015 at 2:06:49 PM UTC+1, Noel Grandin wrote:
>
> Instead of spawning a thread and waiting for it, why not just make a 
> method call? 
> Then you'd be using the same connection by default. 
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to