This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 72223

Summary: Opening a 2nd connection to an Oracle DB fails
Product: db Reporter: smil <smil>
Component: CodeAssignee: Andrei Badea <abadea>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: pjiricka
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description smil 2006-02-03 15:32:49 UTC
Hello,

I tried to open two DB connections at the same time or one ofter the other (same
driver, other URI), the 2nd attempt failed due to an exception. 
It seems that somehow every connection has its own ClassLoader or something like
that.
Maybe database drivers should be red by a higher level classloader.



java.lang.UnsatisfiedLinkError: Native Library
/usr/local/oracle/product/9.2.0/lib/libocijdbc9.so already loaded in another
classloader
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1551)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511)
	at java.lang.Runtime.loadLibrary0(Runtime.java:788)
	at java.lang.System.loadLibrary(System.java:834)
	at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:267)
	at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:365)
	at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:547)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:347)
	at
org.netbeans.modules.db.explorer.DbDriverManager.getConnection(DbDriverManager.java:82)
	at
org.netbeans.modules.db.explorer.DatabaseConnection$2.run(DatabaseConnection.java:498)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
Comment 1 smil 2006-02-03 15:36:30 UTC
Additional info:

The same can be experienced on NB 4.1. 

SunOS fee 5.9 Generic_117171-15 sun4u sparc SUNW,Sun-Fire-V250

java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
Comment 2 Andrei Badea 2006-02-03 16:53:34 UTC
Yes, you are right, we are using a different classloader for every connection.
We already plan to fix it. Thanks for filing the issue!
Comment 3 Andrei Badea 2006-05-29 12:38:48 UTC
I'm afraid this is too hard and time-consuming to fix for 5.5. It requires
caching class loaders, or actually creating a single one, and it is not trivial
to implement correctly. 
Comment 4 Andrei Badea 2006-06-30 19:01:14 UTC
... but it was not very difficult to implement the workaround in issue 76922,
which mitigates the problem quite significantly.

*** This issue has been marked as a duplicate of 76922 ***