File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Derby: Closing Db Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Derby: Closing Db Problem" Watch "Derby: Closing Db Problem" New topic

Derby: Closing Db Problem

ozhan kaya

Joined: Mar 19, 2009
Posts: 13

Whenever i try to close my database connection i am getting an exception.If i dont use shutdown=true then my database keeping lucked even i close my program.

i am using derby embeded...

Thank You in advance...
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

If i dont use shutdown=true then my database keeping lucked even i close my program.

From what i have seen, the DB is shutdown when the JVM exits. How do you "close your program". Is the JVM still running when you "close the program"? And which version of Derby?

[My Blog] [JavaRanch Journal]
ozhan kaya

Joined: Mar 19, 2009
Posts: 13
Sorry for late answer.I got H1N1 virus.

I have latest jdk.When i close my program i mean only close my program, not jvm.After all my program running well and my database are closing properly even i got error messages.
Michael Urban

Joined: Jan 17, 2010
Posts: 1
I ran across this on Google, and I know this thread is a little old, but I figured I would post a reply anyway in case anyone else runs into this.

Basically, this is a weird quirk of Derby in that it actually throws an exception when the shutdown is successful. Code 08006 actually means the database was successfully shutdown. Here's the relevant quote from the Derby documentation:

"A successful shutdown always results in an SQLException to indicate that Derby has shut down and that there is no other exception."

In addition:

"The XJ015 error (successful shutdown of the Derby engine) and the 08006 error (successful shutdown of a single database) are the only exceptions thrown by Derby that might indicate that an operation succeeded. All other exceptions indicate that an operation failed. You should check the log file to be certain."

Yeah, I know it's odd, and it throws a lot of people because the behavior is so unexpected. But rest assured that according to the Derby developer's guide, this is normal and actually indicates the database was shutdown successfully.
Siva Kannan

Joined: Oct 14, 2010
Posts: 4
HI Michael,

I just wanted to thank you for your post on shutting down the derby server. I was getting the exception while shutting down the server and couldn't find the reason for it . Then I saw your message . Once again thank you very much for your post.


I agree. Here's the link:
subject: Derby: Closing Db Problem
It's not a secret anymore!