You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2009/01/25 03:53:59 UTC

[jira] Resolved: (DBCP-271) Thread safety issues in AbandonedTrace class

     [ https://issues.apache.org/jira/browse/DBCP-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz resolved DBCP-271.
------------------------------

    Resolution: Fixed

Made relevant instance fields volatile or final in r737478.

> Thread safety issues in AbandonedTrace class
> --------------------------------------------
>
>                 Key: DBCP-271
>                 URL: https://issues.apache.org/jira/browse/DBCP-271
>             Project: Commons Dbcp
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 1.3
>
>
> DBCP-270 implies that the AbandonedTrace class is called from multiple threads, however it is not thread-safe:
> * SimpleDateFormat  is not threadsafe, but it is called without protection.
> * various instance fields need to be made final to ensure that they are published correctly (memory visibility)
> * getLastUsed/setLastUsed need to be synchronized - or better, createdBy made volatile so printStackTrace can access the variable safely
> (createdBy is rewritten, not updated, so lost updates are not important)
> Also, the Javadoc for printStackTrace() is wrong.

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