Issue Details (XML | Word | Printable)

Key: JDBC-199
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Critical Critical
Assignee: Mark Rotteveel
Reporter: Raphaël Bourges
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
Jaybird JDBC Driver

Glassfish - Pool KO after an exception

Created: 16/Nov/11 01:40 PM   Updated: 08/Dec/11 09:19 PM
Component/s: Connection pool
Affects Version/s: Jaybird 2.1.6
Fix Version/s: None

File Attachments: 1. File CINEPROG.FDB (784 kB)
2. Zip Archive (7.99 MB)
3. Text File exception_pool_firebird.txt (113 kB)
4. Text File log_next_query.txt (21 kB)

Glassfish 3.1.1
Firebird 2.5
JDK 6 update 25 (JPA)

 Description  « Hide
When we get an exception about UNIQUE KEY violation or NOT NULL constraint not satisfied, the pool don't accept anymore queries
=> we have to restart GlassFish

We have a test case here
-the Netbeans project :
- the database :
- the exception log :

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Raphaël Bourges added a comment - 16/Nov/11 01:45 PM - edited
Test Case attached

Mark Rotteveel added a comment - 17/Nov/11 07:42 PM
Could you include reproduction steps to trigger the error?

Mark Rotteveel added a comment - 17/Nov/11 08:08 PM
Never mind my previous request, I already found out how to reproduce it :)

Mark Rotteveel added a comment - 20/Nov/11 05:39 PM
Content of mail I sent to Firebird-Java on 18th of November:

I managed to reproduce this yesterday, but the NPE is triggered inside
eclipselink itself. It is able to successfully store a new object (with
unique title) after the previous unique key constraint violation, but the
subsequent retrieval of the updated list of movies triggers a
NullPointerException when EclipseLink is processing a list of

I am not sure of the cause yet and the many levels of indirection
introduced by EclipseLink don't make it easy to pinpoint. The fact that
Firebird does store the object indicates that the connection itself is not
broken (or only breaks after saving the object). I have not been able to
dive deeper yesterday. I think that this might be a bug in EclipseLink
itself, I have however not yet been able to confirm or deny that.

I did go over the list of EclipseLink changes since 2.2.0, and a number of
NPEs have been fixed, but they didn't look like this problem. I won't have
time until Sunday to look further, but you might want to see if updating to
EclipseLink 2.3.1 helps solve this problem.

Mark Rotteveel added a comment - 20/Nov/11 05:40 PM
I am still struggling with pinpointing the problem, this is going to take more time than I expected.

Mark Rotteveel added a comment - 03/Dec/11 03:40 PM - edited
Posted a topic at to get support from the EclipseLink as I am unable to pinpoint the problem.

Mark Rotteveel added a comment - 08/Dec/11 09:07 PM
The problem is that when the the unique constraint violation exception is thrown by EclipseLink, the exception (DatabaseException) contains detailed information on the cause, including the SQLCall object, which contains an InsertObjectQuery which contains an object of class RelationDescriptor.

When Flex receives this exception, it serializes the exception using a custom serialization protocol. And during that serialization it will serialize everything it considers a bean property. During that serialzation it calls a method called getInheritancePolicy() on the RelationDescriptor. This method has a side-effect, where it will create a new InheritancePolicy if the current value is null. The problem is that Movie does not have inheritance, so the inheritancePolicy should remain null.

If after this exception you create a new object, it will refresh the Movie list, and now due to inheritancePolicy being non-null, it calls a number of methods it should not actually call for this object with the NullPointerException as a result.

In other words: This is not a problem in Jaybird, but in the interaction between how Flex handles the Exception, and the way EclipseLink handles that inheritancePolicy property. I would consider this a bug (or at least a deficiency) in EclipseLink, so I would advise you to file a bug with them.

Mark Rotteveel added a comment - 08/Dec/11 09:19 PM
Closed as 'Won't fix', as the problem is between the interaction of Flex and EclipseLink, not with Jaybird.