следующий код работает правильно с мгновенным клиентом 10g, но зависает при использовании oracle Instant Client 11g, зависает на pool.release (conN),
import time
print '---------------------------------'
import cx_Oracle
print cx_Oracle.clientversion()
time.sleep(1)
pool = cx_Oracle.SessionPool('login', 'pass', "dbserver:1521/db", 1, 6, 2)
pool.timeout = 60
con11 = pool.acquire()
con12 = pool.acquire()
con13 = pool.acquire()
con14 = pool.acquire()
con15 = pool.acquire()
pool.release(con11)
pool.release(con12)
pool.release(con13)
pool.release(con14)
pool.release(con15)
for i in xrange(100000):
print '-=-' + str(i) + '-=-'
print str(pool.opened) + " " + str(pool.busy)
con1 = pool.acquire()
cursor = con1.cursor()
cursor.execute("SELECT * FROM DUAL")
count = cursor.fetchall()[0][0]
cursor.close()
print str(pool.opened) + " " + str(pool.busy)
con2 = pool.acquire()
cursor = con2.cursor()
cursor.execute("SELECT * FROM DUAL")
count = cursor.fetchall()[0][0]
cursor.close()
print str(pool.opened) + " " + str(pool.busy)
con3 = pool.acquire()
cursor = con3.cursor()
cursor.execute("SELECT * FROM DUAL")
count = cursor.fetchall()[0][0]
cursor.close()
print str(pool.opened) + " " + str(pool.busy)
t1 = time.time()
pool.release(con3)
t2 = time.time()
print t2 - t1
print str(pool.opened) + " " + str(pool.busy)
t1 = time.time()
pool.release(con2)
t2 = time.time()
print t2 - t1
t1 = time.time()
pool.release(con1)
t2 = time.time()
print t2 - t1
print str(pool.opened) + " " + str(pool.busy)
print '---------------------------------'
PS: я смотрю на исходный код cx_Oracle, он находится в seesionpool.c на линии
status = OCISessionRelease(connection->handle,
connection->environment->errorHandle, NULL, 0, mode);
Есть идеи, как ее решить?
PPS: ОС Windows XP и 2008R2