[DB-SIG] DCOracle only allows one connection?

pehr anderson pehr@eink.com
Wed, 19 Apr 2000 17:02:18 -0400


Dear Python DB-ers,

I'm using Oracle 8.1.5 on RedHat 6.1 with python-1.5.2-7.
I've tried DCOracle-1.3.0 
	ZOracleDA-2.2.0b1-src.tgz
	ZOracleDA-2.1.0-nonbin.tgz  

My goal is to use this with Zope.

DCOracle seems to only allow one connection per python
session. If I try to connect again, it dumps core.
I realize I should set up one connection with a
long-running process, but for convenience I set up 
a Zope external method that would open a connection, 
do a transaction and close. 

Has anyone else run into this?  I'm only using one
database so persistant connections will work for my app.
I imagine some people will require better behavior.

	-pehr


#!/usr/bin/env python
import sys, DCOracle

def test():
	dbc=DCOracle.Connect("falafel/flatbread")
	c = dbc.cursor()
	c.close()
	dbc.commit()
	dbc.close()

test()
print "Finished 1"
test()
print "Finished 2"


[root@linfoo Extensions]# ./crash.py 
Finished 1
Segmentation fault (core dumped)





Here is a sample GDB Session... not sure if this is useful:

This GDB was configured as "i386-redhat-linux".
(gdb) run
Starting program: /usr/bin/python 
Python 1.5.2 (#1, Sep 17 1999, 20:15:36)  [GCC egcs-2.91.66
19990314/Linux (egcs- on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import DCOracle
>>> d = DCOracle.Connect("falafel/flatbread")
>>> c = d.cursor()
>>> c.close()
>>> d.close()
>>> d = DCOracle.Connect("falafel/flatbread")

Program received signal SIGSEGV, Segmentation fault.
0x400a24ea in chunk_alloc (ar_ptr=0x40137040, nb=16) at malloc.c:2700
2700	malloc.c: No such file or directory.
(gdb) bt
#0  0x400a24ea in chunk_alloc (ar_ptr=0x40137040, nb=16) at
malloc.c:2700
#1  0x400a240a in __libc_malloc (bytes=8) at malloc.c:2643
#2  0x806c01a in ?? ()
#3  0x806c546 in ?? ()
#4  0x8064a09 in ?? ()
#5  0x8054354 in ?? ()
#6  0x8051e49 in ?? ()
#7  0x805421b in ?? ()
#8  0x8053e3a in ?? ()
#9  0x8065efb in ?? ()
#10 0x8053f41 in ?? ()
#11 0x8053e48 in ?? ()
#12 0x8053035 in ?? ()
#13 0x805134b in ?? ()
#14 0x805f874 in ?? ()
#15 0x805ef02 in ?? ()
#16 0x805edb7 in ?? ()
#17 0x805ed17 in ?? ()
#18 0x804fc72 in ?? ()
#19 0x804f7b6 in ?? ()
#20 0x400621eb in __libc_start_main (main=0x804f7a8, argc=1,
argv=0xbffffb04, 
    init=0x804edf4, fini=0x8084c8c, rtld_fini=0x4000a610 <_dl_fini>, 
    stack_end=0xbffffafc) at ../sysdeps/generic/libc-start.c:90