aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Derby: Closing Db Problem" Watch "Derby: Closing Db Problem" New topic
Author

Derby: Closing Db Problem

ozhan kaya
Greenhorn

Joined: Mar 19, 2009
Posts: 13
Hi.

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
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

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
Greenhorn

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
Greenhorn

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
Greenhorn

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.

Regards
Siva

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Derby: Closing Db Problem
 
Similar Threads
Help: Connecting MySQL Database to JTable
connecting to MS-Access
Unable to connect to read-only Embedded Derby database from within EAR file deployed on JBoss server
exception in login page using apache derby
Runtime Exceptions for JDBC program using Derby Client in Netbeans