Re: [cx-oracle-users] Fwd: using cx_Oracle in many threads
Brought to you by:
atuining
|
From: Anthony T. <ant...@gm...> - 2008-11-11 16:42:55
|
On Tue, Nov 11, 2008 at 3:26 AM, Tibor Arpas <ti...@in...> wrote: > Hi, > it looks like not many people use the oracle SessionPool. I was only able to > solve the crash problem by synchronizing the access to database and allowing > just one thread at a time. What third party connection pools are you guys > using in your web applications? SqlAlchemy might do the job, but the > cx_Oracle.SessionPool looked easier for my use. At my previous job we were using session pools extensively. We tested with 30+ threads simultaneously accessing the database for 8-10 hours without a single crash. We did not, however, use ref cursors which you seem to like to use. Its possible that there is a bug in the Oracle client that doesn't handle this situation properly or I'm missing something in my implementation which is causing ref cursors to fall over badly. Any information that anyone can provide on this I'll accept gratefully. :-) > Anyway I've got another problem related to cx_Oracle.SessionPool. When > trying to fetch SDO_GEOMETRY object type from Oracle I get following error: > Traceback (most recent call last): > File "testgeomcursor.py", line 23, in <module> > row = outcur.fetchone() > cx_Oracle.DatabaseError: ORA-21522: attempted to use an invalid connection > in OC > I (object mode only) > When I use plain select or plain connection everything works. Any idea? Unfortunately I cannot test that script since I only have standard edition databases available to me. If you could recreate the problem with a script that uses standard edition features only then I'd be happy to see if I get the same results as you are getting. Anthony |