Precompilers and OCI (MOSC)

MOSC Banner

OCI and MULTI-THREADED problem

edited Sep 25, 2012 11:45AM in Precompilers and OCI (MOSC) 15 commentsAnswered
Hi everyone,

I use OCI in a multi-threaded environment.  The environment handle (created with OCI_THREADED) and the server handle are shared amongst all threads, but all other handles are created, used and freed exclusively in a single thread.

 

Globally, this seems to work fine, except for one crucial aspect : when I create a new connection (service context and session handles) for a new thread while statements are being executed in other threads, very often the statement handles of the other threads become invalid for no reason.

 

Is it possible that OCI does not allow creating new connections while executing in a multi-threaded environment?  Is it required to create all connections beforehand from a single thread?  This would make no sense since it is unknown how many threads (and therefore how many connections) will be required.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center