Multithreding and Connection Pool

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have a legacy C++ app that has two worker threads. Each will
separately instantiate .NET objects using COM interop. One thread does
simple SQL statements and the other does larger SQL inquires. Both use
the same connection string to create their OracleConnection. Both
connect as late as possible and close as soon as possible. I am
assuming they would share the same connection pool because of the same
connection string. We have logging in place that logs the exact time
before and after each DataAdapter fill. Almost once a day the inquiry
will hang on the fill and NEVER return or cause any errors. When we
look at the logs it appears that this happens when they both try to
access a connection in the pool at the exact same time.

After we reach this condition we appear to leak connections and about
1/2 hour later we start getting connection pool timeouts tryng to get a
connection. When we check from the Oracle Server side it will show 1 or
2 connections.

Do, I need to lock the connections before using them? We are testing
using slightly differnt connection strings in case to create multiple
pools.

To make things works we have not been unable to duplicate in a test
environment and only happens in production.

Any help or suggestions would be great!

This is W2K3 SP1 on a 4 way box.

Thanks!
 
Thanks for the reply..

Just to be clear, each .NET instance does create its own
OracleConnection which is surronded by a try catch finally block to
make sure the connection is always closed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top