You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Christian Trimble (JIRA)" <ji...@apache.org> on 2010/10/05 00:27:33 UTC

[jira] Created: (JCR-2767) Database connection leak with DBCP, MySQL, and Observers

Database connection leak with DBCP, MySQL, and Observers
--------------------------------------------------------

                 Key: JCR-2767
                 URL: https://issues.apache.org/jira/browse/JCR-2767
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.1.0
         Environment: Jackrabbit with DBCP and MySQL
            Reporter: Christian Trimble


When using DBCP and MySQL with an observer that modifies the content repository, we are seeing abandoned connections in our connection pool.

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


[jira] Commented: (JCR-2767) Database connection leak with DBCP, MySQL, and Observers

Posted by "Christian Trimble (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917806#action_12917806 ] 

Christian Trimble commented on JCR-2767:
----------------------------------------

The connections that are being abandoned code from line 802 in org.apache.jackrabbit.core.journal.DatabaseJournal.  This class has an instance variable of type org.apache.jackrabbit.core.util.db.ConnectionHelper that it treats as a thread safe object.  However, the batch mode features of this class do not appear to be thread safe.  I have prepared a patch that makes the batch mode features of the ConnectionHelper class by moving its batchConnection into a thread local variable.

> Database connection leak with DBCP, MySQL, and Observers
> --------------------------------------------------------
>
>                 Key: JCR-2767
>                 URL: https://issues.apache.org/jira/browse/JCR-2767
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.1.0
>         Environment: Jackrabbit with DBCP and MySQL
>            Reporter: Christian Trimble
>
> When using DBCP and MySQL with an observer that modifies the content repository, we are seeing abandoned connections in our connection pool.

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


[jira] Resolved: (JCR-2767) Database connection leak with DBCP, MySQL, and Observers

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-2767.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0
         Assignee: Jukka Zitting

Good catch, thanks! Patch committed in revision 1004576.

> Database connection leak with DBCP, MySQL, and Observers
> --------------------------------------------------------
>
>                 Key: JCR-2767
>                 URL: https://issues.apache.org/jira/browse/JCR-2767
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.1.0
>         Environment: Jackrabbit with DBCP and MySQL
>            Reporter: Christian Trimble
>            Assignee: Jukka Zitting
>             Fix For: 2.2.0
>
>         Attachments: connection-helper-thread-safety.patch
>
>
> When using DBCP and MySQL with an observer that modifies the content repository, we are seeing abandoned connections in our connection pool.

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


[jira] Updated: (JCR-2767) Database connection leak with DBCP, MySQL, and Observers

Posted by "Christian Trimble (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Trimble updated JCR-2767:
-----------------------------------

    Attachment: connection-helper-thread-safety.patch

This patch makes the ConnectionHelper class thread safe.  This class was not thread safe when running in batch mode, since all threads share the batch mode flag.  This patch replaces that flag with a thread local variable, so every thread accessing the helper can have its own batch connection.

> Database connection leak with DBCP, MySQL, and Observers
> --------------------------------------------------------
>
>                 Key: JCR-2767
>                 URL: https://issues.apache.org/jira/browse/JCR-2767
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.1.0
>         Environment: Jackrabbit with DBCP and MySQL
>            Reporter: Christian Trimble
>         Attachments: connection-helper-thread-safety.patch
>
>
> When using DBCP and MySQL with an observer that modifies the content repository, we are seeing abandoned connections in our connection pool.

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