Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Where Is The Documentation and Examples For Eclipselink Exceptions especially Persistence Exception
Where Is The Documentation and Examples For Eclipselink Exceptions especially Persistence Exception [message #868400] Tue, 01 May 2012 22:22 Go to next message
Bill R is currently offline Bill RFriend
Messages: 1
Registered: May 2012
Junior Member
Is there any documentation anywhere that gives information on how to handle exceptions with eclipselink. Especially documentation with examples. As part of JPA it is supposed to give PersistenceException's but all I seem to see are things like: "Caused by: Exception [EclipseLink-4002]" which is close to useless (especially as this universal 4002 seems to be just a general sql exception that can encompass a number of issues).

If I could find good documentation on how to handle these exceptions it would be great. There are a ton of web sites telling how to use eclipselink and JPA and they are all happy path scenarios. Not one I've found says how to trap and derive meaningful information from eclipselink exceptions. It is quite common for database interactions to bump into unique constraints etc. In fact I have found a number of issues on forums with this same problem and people trying to hack something from the native error message that usually also show up. But the PersistenceException is supposed to remove the need to do this, and it is not a good idea to do regardless.

So please, let me know what you know in terms of exception handling.

Regards,

b
Re: Where Is The Documentation and Examples For Eclipselink Exceptions especially Persistence Except [message #869520 is a reply to message #868400] Thu, 03 May 2012 14:25 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

For a database exception, PersistenceException will wrap a EclipseLink DatabaseException, which will wrap a JDBC SQLException.

The SQLException will have the databases error code in it.

You can access the cause for any exception using getCause().


James : Wiki : Book : Blog : Twitter
Previous Topic:Use of sequences with EclipseLink (native) and Postgres
Next Topic:Trying to use OPERATOR fails
Goto Forum:
  


Current Time: Thu Apr 25 19:17:17 GMT 2024

Powered by FUDForum. Page generated in 0.02968 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top