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 - Opening a 2nd connection to an Oracle DB fails
Summary: Opening a 2nd connection to an Oracle DB fails
Status: RESOLVED DUPLICATE of bug 76922
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-03 15:32 UTC by smil
Modified: 2006-06-30 19:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***