jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes Primary Key Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Primary Key Exception" Watch "Primary Key Exception" New topic

Primary Key Exception

ford Darcy Jr
Ranch Hand

Joined: Jan 26, 2005
Posts: 76

I have an insert application, which has a primary key column. If any primary key exceptions are encountered, its been caught in the try-catch block. But, whenever I get any primary key exceptions, I need to restart my webserver to continue inserting the record. Is there any solution for this, without the webserver restart.

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Don't know if this is a JDBC problem, or a problem with a particular app server, but either way, it sure ain't a Java Beginner's problem. I'm going to move this to JDBC.

[Jess in Action][AskingGoodQuestions]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

This is probably the application or the app server (not the web server.) What app server are you using?

Are you using auto-commit or transactions? You may have a lock in use.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link: http://aspose.com/file-tools
subject: Primary Key Exception
It's not a secret anymore!