Hi, Derby folks. John is having trouble using Derby in a custom classloader when running in Java 6. See the thread below. Is this a known issue? Any ideas why this might be happening?
Thanks, David ---------- Forwarded message ---------- From: David Van Couvering <[EMAIL PROTECTED]> Date: Jan 14, 2008 12:08 PM Subject: Re: [nbusers] == I got issues with JavaDB on 6 == To: [EMAIL PROTECTED] Wow, a lot happens when you go away for the weekend :) it's really hard to track down what this issue is, and it looks like you may not be motivated to help us, Johnny, since you already moved to H2 :) I do want to clarify a few things though, just so there is no confusion: - Java DB that is embedded in JDK 6 is not used automatically when you use the Java 6 VM. It must be explicitly included in your classpath. - When using Java DB embedded, you can't run into incompatibilities because derby.jar is a single jar file that contains everything you need, from the JDBC driver to the full runtime of the database Finally, I have a question: you mention that it works fine "outside of a classloader" - I am having trouble picturing how a Java application can run outside of a classloader. Do you mean that it's using the default system classloader? What do you mean when it's running in a customer classloader? Does this problem happen outside of NetBeans or only inside NetBeans? If it happens outside, then this is a generic Derby/Java DB issue and we should report the bug with the Apache Derby community. Thanks for any time you can spend on this Johnny, I know you've already moved on :) David On Jan 13, 2008 12:42 PM, Johnny Kewl <[EMAIL PROTECTED]> wrote: > > > > Mayuresh Nirhali > > Hi there... I did end up spending an enormous amount of time on it and > unfortunately I cant figure out exactly what the problem is... I will gladly > post you the test code if you wish to examine, I could well be making a > mistake somewhere. It also may not be related directly to JavaDB, it may > well be coming from the JDBC archetecture, in Java6. > > But here are the symptoms > > + Running outside classloader... Derby Embedded works. > + Running inside another classloader... Derby Embedded is very sensitive to > any exception... if that happens, the underlying dB connection is gone. > > In the identical application, if I run the H2 embedded dB or the HSQLdB... > it works! > > This problem does not show on Java5, only on Java6 > > Thats all I can tell you... something weird is happening and it happens on > other machines as well. > Its damn difficult to test because you need to build a custom class loader > to see it happening. > and its intermittant... it sometimes gets through and works. > > Yes I know they the same... thats the problem, because the characteristic > has changed on Java6, and even if I go load Apache Derby, compile it on Java > 5... it STILL does this on Java6... so that means working apps are breaking. > > My immediate problem is solved, I moved to H2, but maybe Sun want to just > think about this... why would identicle software behave differently under a > new JRE... so if JDBC has changed... the problem may be there, but I cant > figure it out because other embedded dB's work, but then they still maybe > under a slightly older JDBC version... even though I am using the latest > third party software.... mystery! and probably not that serious to 95% of > Derby users. > > It points at Derby on Java6... but nothing makes sense to me. If I could get > another embedded java dB to do this... then it would suggest a my coding > problem.... it doesnt ;) > > Anyway dont worry, just make a note of it... it will probably crop up again > as app move to Java6 > ..... > > > > =================================== > > To: [EMAIL PROTECTED] > Sent: Sunday, January 13, 2008 5:24 AM > > Subject: Re: [nbusers] == I got issues with JavaDB on 6 == > > > > > > On Jan 12, 2008 6:04 PM, Johnny Kewl <[EMAIL PROTECTED]> wrote: > > > The first problem that you will find with that is that the dB from the > > Apache Derby version is probably incompatible with that version... so > thats > > the first gotcha, the new derby raises exceptions, when it tries to access > > the old embedded dB. > > But other than that they seem, to be identicle products.... BUT from more > > research there are little worrying things... like these new transient > > exceptions that I have never seen before... and the way Java6 is treating > > Derby internally seems to have changed... for example they say that > > DriverManager.getConnection(url) > > is no longer required and will happen automatically when the first call to > > the dB is made.... which I guess is wonderful for new code but I'm not > > rewriting dB pools just for that ;) > > > > > > Apache Derby and JavaDB *are* identical. There is no slight chance that > there behavior will differ in any possible way because JavaDB is essentially > same set of jar files taken from apache derby project. So, Let us get this > confusion clarified before we understand the Exception you are seeing. > > Mayuresh > -- David W. Van Couvering http://davidvancouvering.blogspot.com -- David W. Van Couvering http://davidvancouvering.blogspot.com
