Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glassfish - Pool KO after an exception [JDBC199] #248

Closed
firebird-automations opened this issue Nov 16, 2011 · 13 comments
Closed

Glassfish - Pool KO after an exception [JDBC199] #248

firebird-automations opened this issue Nov 16, 2011 · 13 comments

Comments

@firebird-automations
Copy link

Submitted by: Raphaël Bourges (raphael)

Attachments:
CineProg.zip
CINEPROG.FDB
exception_pool_firebird.txt
log_next_query.txt

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 : http://ftp.cinematheque.fr/retrait/CineProg.zip
- the database : http://ftp.cinematheque.fr/retrait/CINEPROG.fdb
- the exception log : http://ftp.cinematheque.fr/retrait/exception_pool_firebird.txt

@firebird-automations
Copy link
Author

Commented by: Raphaël Bourges (raphael)

Test Case attached

@firebird-automations
Copy link
Author

Modified by: Raphaël Bourges (raphael)

Attachment: CineProg.zip [ 12051 ]

Attachment: CINEPROG.FDB [ 12052 ]

Attachment: exception_pool_firebird.txt [ 12053 ]

@firebird-automations
Copy link
Author

Modified by: Raphaël Bourges (raphael)

Attachment: log_next_query.txt [ 12054 ]

@firebird-automations
Copy link
Author

Modified by: @dyemanov

security: Developers [ 10012 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

assignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Could you include reproduction steps to trigger the error?

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Never mind my previous request, I already found out how to reproduce it :)

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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
DatabaseFields.

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.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

I am still struggling with pinpointing the problem, this is going to take more time than I expected.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Posted a topic at http://www.eclipse.org/forums/index.php/t/263189/ to get support from the EclipseLink as I am unable to pinpoint the problem.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Closed as 'Won't fix', as the problem is between the interaction of Flex and EclipseLink, not with Jaybird.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants