> > Concurrently? Do you mean that you a sharing one connection between
> > several threads?
>
> Yes. I didn't see a hint why this should be problematic.
You should use a connection pool: open a few connections beforehand, and
each thread can then request one for it's exclusive use, and then give
it back after finishing. There are lots of possible
strategies/variations you could apply to the nr. of initial connections,
how to grow/shrink that depending on load, what happens if there are too
many connections open and there's a new connection (you can wait or
throw exception), etc.
Google around or search this list for "connection pool" and I'm sure
you'll find a lot of hints and code examples.
Cheers,
Csaba.