-
Notifications
You must be signed in to change notification settings - Fork 305
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
PAYARA-2267 JPA Conversion now unwraps connection properly #2279
Conversation
jenkins test please |
return con; | ||
public Connection getConnection() throws SQLException { | ||
//To ensure that the actual connection is always returned and not a proxy | ||
Connection result = con.unwrap(java.sql.Connection.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe blindly unwrapping on getConnection is the correct fix. I think the problem is why unwrap is failing. However I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is also missing //Portions Copyright comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unwrap was never called, and based on the comment above the method then the actual connection should be returned and not a wrapped version of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unwrap connection is not not used anywhere else in Payara or Eclipselink, unless its done via reflection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also do not believe this is the correct fix.
unwrap() is called by the user to get access to underlying proprietary classes.
Proxy should be returned, not the raw connection here
jenkins test please |
Quick build and test passed! |
@smillidge Is this now okay to be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs further review, as unwrap() isn't the correct solution in my opinion
No description provided.