facebook

Database Explorer driver binds to library permanently

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #220387 Reply

    chad.roberts
    Member

    – System Setup ——————————-
    Operating System and version: XP
    Eclipse version: 3.0.1
    Eclipse build id:
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins:
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 3
    MyEclipse version: 3.8.2
    Eclipse JDK version: 1.4.2
    Application Server JDK version:
    Are there any exceptions in the Eclipse log file?

    – Message Body ——————————-

    When using the Database Explorer it appears that when I map a driver to my library it will bind and cannot be removed and it cannot be used by more than one driver.

    The problem started just because I was supposed to type ‘jdbc:db2:NCJDEV’ but accidentally typed ‘jdbc:odbc:NCJDEV’. But now I am stuck and can’t get it to forget my initial attempt. When I try to change it I get this error:

    Error Adding Driver: java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\SQLLIB\bin\db2jdbc.dll already loaded in another classloader

    Editing or even removing the database explorer driver does not release the binding. I have even tried uninstalling and re-installing the myeclipse plugin but when I return to the preference settings it still remembers everything and can’t be changed.

    Thank you, I appreciate the help.

    Mark

    #220402 Reply

    Riyad Kalla
    Member

    Interesting… the DLL issue is a side effect of how Java treats them, not necessarily an Eclipse issue… but I will ask the DB dev to see if there is something we can do to lazy-load the DLL to avoid things like this.

    #220539 Reply

    support-jeff
    Member

    This is a known issue with the DB Explorer and type-2 drivers. I have a fix request in the queue, but it has not been prioritized for the current release. I will add your post to the request.

    #231992 Reply

    Hi,

    I just installed M2 and was disappointed that this bug was not fixed.
    I know that the problem lies within the JVM but there must be a workaround for MyEclipseIDE.
    I tried copying the dll to winnt/system32 on a running system, so MyEclipseIDE would be independent from other apps which probably loaded this dll before.
    I got the same error. I tried to delete the dll but couldn’t – it was locked. I had to quit Eclipse – then it worked. So it’s obvious that MyEclipseIDE is locking the DLL itself [1] when trying to invoke the driver.

    Please, fix this!

    Regards,

    Matthias

    [1] it was a fresh eclipse3.1-installation with no other plugins and not even projects

    #243470 Reply

    Daniel Hodnett
    Participant

    bummed out …

    This issue still exists in ver 4.0.3 GA ( build 20051025-4.0.3-GA )
    when attempting a connection in the Database Explorer perspective after
    having connected to same db when running application in the Java perspective
    I get a notification popup with a message like:
    “db2jdbc.dll already loaded in another classloader”

    only the first connection attempt using the same driver will succeed.

    if I run the Database Explorer first ( after a fresh restart ) then the connection
    attempt will succeed, of course ( but the application connect will fail )

    #243475 Reply

    Daniel Hodnett
    Participant

    This is the same problem, in another form, as reported in another thread
    “Classloader Errors with 4.0M2 and the Eclipse BIRT project”
    Here is the link:
    https://www.genuitec.com/forums/topic/classloader-errors-with-4-0m2-and-the-eclipse-birt-project/

    #243477 Reply

    Brian Fernandes
    Moderator

    dhodnett,

    I bumped the issue on our internal issue tracker. Is using a Type 3 driver to connect to the database from the DB explorer a viable alternative for you? You can use the Type 3 driver in the Browser and continue to use your current driver for your application.

    Best,
    Brian.

    #245610 Reply

    janolaveide
    Member

    Still a problem in 4.1, very disappointed…

    #245619 Reply

    Brian Fernandes
    Moderator

    Yes, we know 🙁

    This issue is active on our internal issue tracker; unfortunately it was not as highly prioritized as other 4.1GA items and we did not get the time to come around to it.
    We are going to try and get a fix in for 4.1.1.

    Sorry for the delay and inconvenice,

    Best,
    Brian.

    #246451 Reply

    Brian Fernandes
    Moderator

    Guys,

    We have started investigating this DLL locking issue internally.
    1) I setup a connection to DB2 via a type 2 driver using the DB explorer.
    2) In the Java perspective of the same eclipse instance which is connected to DB2, I ran a small standalone java application which simply connects to DB2 using the same driver, user details and connect string.

    The application ran without a hitch. I restarted eclipse and tried the converse – I ran the app first, and then tried to connect to the DB2 database in the DB Explorer; again, no problems.

    The restriction that Java places on DLLs is that they maybe loaded by only a single classloader per JVM. I verified that the DB Explorer does not attempt to violate this rule.
    If you are running applications, AFAIK, Eclipse spins up a new JVM instance to run your application, so even though the DLL is loaded by a classloader already, it’s in another JVM (the one running Eclipse) so there shouldn’t be a conflict.

    Have I misunderstood the scenario you are trying to describe? Do you have any other plugins running with Eclipse which might interfere with the DLL or is your application doing something unusual?

    I’m assuming you are on Windows – please note your DB2 Database and Driver versions. Also post your error log when you see this problem. More instructions here: Posting Guidelines

    Best,
    Brian.

    #248669 Reply

    janolaveide
    Member

    works for me now in 4.1.1 GA

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: Database Explorer driver binds to library permanently

You must be logged in to post in the forum log in