openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wolverton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1706) In JDBCStoreManager . connect method, should check if connection is closed
Date Sat, 17 Jul 2010 22:50:49 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889544#action_12889544
] 

David Wolverton commented on OPENJPA-1706:
------------------------------------------

In response to Rick's first comment:

IWe had a larger problem that a Spring managed transaction was bound to the thread and never
closed so requests to our webapp kept using the same transaction. Eventually the underlying
connection for the transaction closed but and an error was thrown when when JPA was still
trying to use that closed conneciton.

In our case patching the JPA code here was a cure for the one symptom but until we tracked
down the root cause of the transaction leak, we still had other issues.

> In JDBCStoreManager . connect method, should check if connection is closed
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-1706
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1706
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 2.0.0
>         Environment: We were using 1.2.2, but I see the same problem code in trunk.
>            Reporter: David Wolverton
>            Assignee: Rick Curtis
>            Priority: Minor
>         Attachments: OPENJPA-1706.patch
>
>
> The code currently reads:
> // connect if the connection is currently null, or if
> // the connection has been closed out from under us
> if (_conn == null)
>     _conn = connectInternal();
> The comment indicates that it should check for null or closed, but the code only checks
for closed. Our application got to the state where connection was actually closed but not
null. We patched this with the following code to make it work:
> if (_conn == null || _conn.isClosed())
>     _conn = connectInternal();

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message