Skip to main content



      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 18:22 Go to next message
Eclipse UserFriend
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 10:25 Go to previous message
Eclipse UserFriend
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().
Previous Topic:Use of sequences with EclipseLink (native) and Postgres
Next Topic:Trying to use OPERATOR fails
Goto Forum:
  


Current Time: Wed Jul 23 02:27:12 EDT 2025

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

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

Back to the top