[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1227) Statement leak in HandleBeforeCommit1PCRunner

Tim Fox (JIRA) jira-events at lists.jboss.org
Thu Jan 31 03:02:59 EST 2008


    [ http://jira.jboss.com/jira/browse/JBMESSAGING-1227?page=comments#action_12397611 ] 
            
Tim Fox commented on JBMESSAGING-1227:
--------------------------------------

This is a duplicate of http://jira.jboss.org/jira/browse/JBMESSAGING-1218 which was fixed in Branch_stable a few weeks ago

See http://viewvc.jboss.org/cgi-bin/viewvc.cgi/messaging/branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java/?revision=3560&r1=3560&r2=3559

It's irratating but benign - the only -ve effect is an annoying warn in logs.

This is going in the first EAP 4.3 CP.

> Statement leak in HandleBeforeCommit1PCRunner
> ---------------------------------------------
>
>                 Key: JBMESSAGING-1227
>                 URL: http://jira.jboss.com/jira/browse/JBMESSAGING-1227
>             Project: JBoss Messaging
>          Issue Type: Bug
>    Affects Versions: 1.4.0.SP3
>            Reporter: Kevin Conner
>         Assigned To: Tim Fox
>            Priority: Blocker
>
> From JBESB-1450
> "This leak appears to be coming from JBoss Messaging, specifically JDBCPersistenceManager$1HandleBeforeCommit1PCRunner.doTransaction(JDBCPersistenceManager.java:1587)
> This line creates a prepared statement within a loop but only the last statement created will be released. Other examples of this construct, within this file, use a simple guard to prevent subsequent allocations. This appears to be the only occurrence which does not."
> "The following change fixes the leak.
> Index: src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
> ===================================================================
> --- src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java (revision 3648)
> +++ src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java (working copy)
> @@ -1584,8 +1584,11 @@
>                    ChannelRefPair pair = (ChannelRefPair) i.next();
>                    MessageReference ref = pair.ref;
>  
> - psReference = conn
> + if (psReference == null)
> + {
> + psReference = conn
>                          .prepareStatement(getSQLStatement("INSERT_MESSAGE_REF"));
> + }
>  
>                    // Now store the reference
>                    addReference(pair.channelID, ref, psReference, false);
> "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list