Issue1430

classification
Title: Oracle JDBC Connection close
Type: Severity: normal
Components: Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: cgroves Nosy List: cgroves, lijihuai, pjenvey
Priority: high Keywords:

Created on 2009-08-10.08:40:33 by lijihuai, last changed 2009-08-17.01:10:49 by lijihuai.

Files
File name Uploaded Description Edit Remove
jdbc_connection_close_bug.png lijihuai, 2009-08-10.08:40:33 jdbc connection of oracle can not be closed
unnamed lijihuai, 2009-08-12.05:20:35
issue1430.tar.gz pjenvey, 2009-08-16.00:55:22
unnamed lijihuai, 2009-08-17.01:10:48
Messages
msg5017 (view) Author: Philip Jenvey (pjenvey) Date: 2009-08-12.03:57:23
I was able to reproduce this. The oracle Connection object implements 3 
DBAccess interfaces that define their own close methods that take 1 
argument. For some reason the descriptor for close gets confused into 
thinking they are the only available close() methods:

>>> c = 
DriverManager.getConnection('jdbc:oracle:thin:@192.168.21.128:1521:xe', 
'scott', 'tiger')
>>> c.close()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: close(): expected 1 args; got 0
>>> c
oracle.jdbc.driver.T4CConnection@d27a744
>>> T4CConnection = type(c)
>>> T4CConnection.close.printArgs()
nargs: 3
interface oracle.sql.BfileDBAccess, false, 0, public abstract void 
oracle.sql.BfileDBAccess.close(oracle.sql.BFILE) throws 
java.sql.SQLException
	(oracle.sql.BFILE, )
interface oracle.sql.BlobDBAccess, false, 0, public abstract void 
oracle.sql.BlobDBAccess.close(oracle.sql.BLOB) throws 
java.sql.SQLException
	(oracle.sql.BLOB, )
interface oracle.sql.ClobDBAccess, false, 0, public abstract void 
oracle.sql.ClobDBAccess.close(oracle.sql.CLOB) throws 
java.sql.SQLException
	(oracle.sql.CLOB, )
>>> T4CConnection.__bases__
(<type 'oracle.sql.BfileDBAccess'>, <type 'oracle.sql.BlobDBAccess'>, 
<type 'oracle.sql.ClobDBAccess'>, <type 
'oracle.jdbc.driver.PhysicalConnection'>)
>>> T4CConnection.__mro__  
(<type 'oracle.jdbc.driver.T4CConnection'>, <type 
'oracle.sql.BfileDBAccess'>, <type 'oracle.sql.BlobDBAccess'>, <type 
'oracle.sql.ClobDBAccess'>, <type 
'oracle.jdbc.driver.PhysicalConnection'>, <type 
'oracle.jdbc.driver.OracleConnection'>, <type 
'oracle.jdbc.internal.OracleConnection'>, <type 
'oracle.jdbc.internal.ClientDataSupport'>, <type 
'oracle.jdbc.OracleConnectionWrapper'>, <type 
'oracle.jdbc.OracleConnection'>, <type 'java.sql.Connection'>, <type 
'java.sql.Wrapper'>, <type 'java.lang.Object'>, <type 'object'>)
>>> for t in T4CConnection.__mro__:  
...     if hasattr(t, 'close'):  % t 
...         print '---- %s ----' % t 
...         print t.close.printArgs()
... 
---- <type 'oracle.jdbc.driver.T4CConnection'> ----
nargs: 3
interface oracle.sql.BfileDBAccess, false, 0, public abstract void 
oracle.sql.BfileDBAccess.close(oracle.sql.BFILE) throws 
java.sql.SQLException
	(oracle.sql.BFILE, )
interface oracle.sql.BlobDBAccess, false, 0, public abstract void 
oracle.sql.BlobDBAccess.close(oracle.sql.BLOB) throws 
java.sql.SQLException
	(oracle.sql.BLOB, )
interface oracle.sql.ClobDBAccess, false, 0, public abstract void 
oracle.sql.ClobDBAccess.close(oracle.sql.CLOB) throws 
java.sql.SQLException
	(oracle.sql.CLOB, )
None
---- <type 'oracle.sql.BfileDBAccess'> ----
nargs: 1
interface oracle.sql.BfileDBAccess, false, 0, public abstract void 
oracle.sql.BfileDBAccess.close(oracle.sql.BFILE) throws 
java.sql.SQLException
	(oracle.sql.BFILE, )
None
---- <type 'oracle.sql.BlobDBAccess'> ----
nargs: 1
interface oracle.sql.BlobDBAccess, false, 0, public abstract void 
oracle.sql.BlobDBAccess.close(oracle.sql.BLOB) throws 
java.sql.SQLException
	(oracle.sql.BLOB, )
None
---- <type 'oracle.sql.ClobDBAccess'> ----
nargs: 1
interface oracle.sql.ClobDBAccess, false, 0, public abstract void 
oracle.sql.ClobDBAccess.close(oracle.sql.CLOB) throws 
java.sql.SQLException
	(oracle.sql.CLOB, )
None
---- <type 'oracle.jdbc.driver.PhysicalConnection'> ----
nargs: 3
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close() throws java.sql.SQLException
	()
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(int) throws 
java.sql.SQLException
	(int, )
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(java.util.Properties) throws 
java.sql.SQLException
	(java.util.Properties, )
None
---- <type 'oracle.jdbc.driver.OracleConnection'> ----
nargs: 3
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
	()
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(int) throws java.sql.SQLException
	(int, )
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(java.util.Properties) throws 
java.sql.SQLException
	(java.util.Properties, )
None
---- <type 'oracle.jdbc.internal.OracleConnection'> ----
nargs: 3
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
	()
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(int) throws java.sql.SQLException
	(int, )
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(java.util.Properties) throws 
java.sql.SQLException
	(java.util.Properties, )
None
---- <type 'oracle.jdbc.OracleConnectionWrapper'> ----
nargs: 3
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close() throws java.sql.SQLException
	()
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(int) throws 
java.sql.SQLException
	(int, )
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(java.util.Properties) throws 
java.sql.SQLException
	(java.util.Properties, )
None
---- <type 'oracle.jdbc.OracleConnection'> ----
nargs: 3
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
	()
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(int) throws java.sql.SQLException
	(int, )
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(java.util.Properties) throws 
java.sql.SQLException
	(java.util.Properties, )
None
---- <type 'java.sql.Connection'> ----
nargs: 1
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
	()
None
msg5019 (view) Author: lijihuai (lijihuai) Date: 2009-08-12.05:20:36
Philip Jenvey,你好

    just waiting next release ?

    to a javaer, working with jython is happy

lijihuai,lijihuai@126.com
2009-08-12 
----- Original Message ----- 
From: Philip Jenvey 
To: lijihuai 
Sent: 2009-08-12, 11:57:25
Subject: [issue1430] Oracle JDBC Connection close

New submission from Philip Jenvey <pjenvey@users.sourceforge.net>:

I was able to reproduce this. The oracle Connection object implements 3 
DBAccess interfaces that define their own close methods that take 1 
argument. For some reason the descriptor for close gets confused into 
thinking they are the only available close() methods:

DriverManager.getConnection('jdbc:oracle:thin:@192.168.21.128:1521:xe', 
'scott', 'tiger')
>>> c.close()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: close(): expected 1 args; got 0
>>> c
oracle.jdbc.driver.T4CConnection@d27a744
>>> T4CConnection = type(c)
>>> T4CConnection.close.printArgs()
nargs: 3
interface oracle.sql.BfileDBAccess, false, 0, public abstract void 
oracle.sql.BfileDBAccess.close(oracle.sql.BFILE) throws 
java.sql.SQLException
  (oracle.sql.BFILE, )
interface oracle.sql.BlobDBAccess, false, 0, public abstract void 
oracle.sql.BlobDBAccess.close(oracle.sql.BLOB) throws 
java.sql.SQLException
  (oracle.sql.BLOB, )
interface oracle.sql.ClobDBAccess, false, 0, public abstract void 
oracle.sql.ClobDBAccess.close(oracle.sql.CLOB) throws 
java.sql.SQLException
  (oracle.sql.CLOB, )
>>> T4CConnection.__bases__
(<type 'oracle.sql.BfileDBAccess'>, <type 'oracle.sql.BlobDBAccess'>, 
<type 'oracle.sql.ClobDBAccess'>, <type 
'oracle.jdbc.driver.PhysicalConnection'>)
>>> T4CConnection.__mro__ 
(<type 'oracle.jdbc.driver.T4CConnection'>, <type 
'oracle.sql.BfileDBAccess'>, <type 'oracle.sql.BlobDBAccess'>, <type 
'oracle.sql.ClobDBAccess'>, <type 
'oracle.jdbc.driver.PhysicalConnection'>, <type 
'oracle.jdbc.driver.OracleConnection'>, <type 
'oracle.jdbc.internal.OracleConnection'>, <type 
'oracle.jdbc.internal.ClientDataSupport'>, <type 
'oracle.jdbc.OracleConnectionWrapper'>, <type 
'oracle.jdbc.OracleConnection'>, <type 'java.sql.Connection'>, <type 
'java.sql.Wrapper'>, <type 'java.lang.Object'>, <type 'object'>)
>>> for t in T4CConnection.__mro__: 
.... if hasattr(t, 'close'): % t 
.... print '---- %s ----' % t 
.... print t.close.printArgs()
.... 
---- <type 'oracle.jdbc.driver.T4CConnection'> ----
nargs: 3
interface oracle.sql.BfileDBAccess, false, 0, public abstract void 
oracle.sql.BfileDBAccess.close(oracle.sql.BFILE) throws 
java.sql.SQLException
  (oracle.sql.BFILE, )
interface oracle.sql.BlobDBAccess, false, 0, public abstract void 
oracle.sql.BlobDBAccess.close(oracle.sql.BLOB) throws 
java.sql.SQLException
  (oracle.sql.BLOB, )
interface oracle.sql.ClobDBAccess, false, 0, public abstract void 
oracle.sql.ClobDBAccess.close(oracle.sql.CLOB) throws 
java.sql.SQLException
  (oracle.sql.CLOB, )
None
---- <type 'oracle.sql.BfileDBAccess'> ----
nargs: 1
interface oracle.sql.BfileDBAccess, false, 0, public abstract void 
oracle.sql.BfileDBAccess.close(oracle.sql.BFILE) throws 
java.sql.SQLException
  (oracle.sql.BFILE, )
None
---- <type 'oracle.sql.BlobDBAccess'> ----
nargs: 1
interface oracle.sql.BlobDBAccess, false, 0, public abstract void 
oracle.sql.BlobDBAccess.close(oracle.sql.BLOB) throws 
java.sql.SQLException
  (oracle.sql.BLOB, )
None
---- <type 'oracle.sql.ClobDBAccess'> ----
nargs: 1
interface oracle.sql.ClobDBAccess, false, 0, public abstract void 
oracle.sql.ClobDBAccess.close(oracle.sql.CLOB) throws 
java.sql.SQLException
  (oracle.sql.CLOB, )
None
---- <type 'oracle.jdbc.driver.PhysicalConnection'> ----
nargs: 3
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close() throws java.sql.SQLException
  ()
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(int) throws 
java.sql.SQLException
  (int, )
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(java.util.Properties) throws 
java.sql.SQLException
  (java.util.Properties, )
None
---- <type 'oracle.jdbc.driver.OracleConnection'> ----
nargs: 3
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
  ()
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(int) throws java.sql.SQLException
  (int, )
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(java.util.Properties) throws 
java.sql.SQLException
  (java.util.Properties, )
None
---- <type 'oracle.jdbc.internal.OracleConnection'> ----
nargs: 3
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
  ()
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(int) throws java.sql.SQLException
  (int, )
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(java.util.Properties) throws 
java.sql.SQLException
  (java.util.Properties, )
None
---- <type 'oracle.jdbc.OracleConnectionWrapper'> ----
nargs: 3
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close() throws java.sql.SQLException
  ()
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(int) throws 
java.sql.SQLException
  (int, )
class oracle.jdbc.OracleConnectionWrapper, false, 0, public void 
oracle.jdbc.OracleConnectionWrapper.close(java.util.Properties) throws 
java.sql.SQLException
  (java.util.Properties, )
None
---- <type 'oracle.jdbc.OracleConnection'> ----
nargs: 3
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
  ()
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(int) throws java.sql.SQLException
  (int, )
interface oracle.jdbc.OracleConnection, false, 0, public abstract void 
oracle.jdbc.OracleConnection.close(java.util.Properties) throws 
java.sql.SQLException
  (java.util.Properties, )
None
---- <type 'java.sql.Connection'> ----
nargs: 1
interface java.sql.Connection, false, 0, public abstract void 
java.sql.Connection.close() throws java.sql.SQLException
  ()
None

----------
nosy: +cgroves, pjenvey
priority: -> high

_______________________________________
Jython tracker <report@bugs.jython.org>
<http://bugs.jython.org/issue1430>
_______________________________________
msg5028 (view) Author: Charlie Groves (cgroves) Date: 2009-08-15.20:39:40
Is there some javadoc or something like that online for the Connection 
object in question?  I'd like to make something or the same form as a test 
for Jython to try to fix this.
msg5036 (view) Author: Philip Jenvey (pjenvey) Date: 2009-08-16.00:55:22
I narrowed this down since I could reproduce it. Basically one of the 
classes in the chain isn't public but overrides 
java.sql.Connection.close. That combined with the interfaces having 
their own different close method causes the java.sql.Connection.close to 
not show up

Extract the tar ball and run:
$ jython test.py 
nargs: 1
interface SpecialConnection, false, 0, public abstract void 
SpecialConnection.close(int)
	(int, )
None
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    c.close()
TypeError: close(): expected 1 args; got 0
msg5043 (view) Author: Charlie Groves (cgroves) Date: 2009-08-16.10:30:12
Should be fixed in r6676.  Thanks for the report!
msg5048 (view) Author: lijihuai (lijihuai) Date: 2009-08-17.01:10:49
Philip Jenvey,你好

     thanks

     it's a great project

lijihuai,lijihuai@126.com
2009-08-17 
----- Original Message ----- 
From: Philip Jenvey 
To: lijihuai 
Sent: 2009-08-16, 08:55:22
Subject: [issue1430] Oracle JDBC Connection close

Philip Jenvey <pjenvey@users.sourceforge.net> added the comment:

I narrowed this down since I could reproduce it. Basically one of the 
classes in the chain isn't public but overrides 
java.sql.Connection.close. That combined with the interfaces having 
their own different close method causes the java.sql.Connection.close to 
not show up

Extract the tar ball and run:
$ jython test.py 
nargs: 1
interface SpecialConnection, false, 0, public abstract void 
SpecialConnection.close(int)
  (int, )
None
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    c.close()
TypeError: close(): expected 1 args; got 0

----------
assignee: -> cgroves
Added file: http://bugs.jython.org/file723/issue1430.tar.gz

_______________________________________
Jython tracker <report@bugs.jython.org>
<http://bugs.jython.org/issue1430>
_______________________________________
History
Date User Action Args
2009-08-17 01:10:49lijihuaisetfiles: + unnamed
messages: + msg5048
2009-08-16 10:30:12cgrovessetstatus: open -> closed
resolution: fixed
messages: + msg5043
2009-08-16 00:55:22pjenveysetfiles: + issue1430.tar.gz
assignee: cgroves
messages: + msg5036
2009-08-15 20:39:40cgrovessetmessages: + msg5028
2009-08-12 05:20:36lijihuaisetfiles: + unnamed
messages: + msg5019
2009-08-12 03:57:25pjenveysetpriority: high
nosy: + cgroves, pjenvey
messages: + msg5017
2009-08-10 08:40:33lijihuaicreate