db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4724) Unsafe synchronization in GenericStatement
Date Thu, 17 Feb 2011 00:01:25 GMT

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

Dag H. Wanvik updated DERBY-4724:
---------------------------------

    Urgency: Low
     Labels: derby_triage10_8  (was: )

> Unsafe synchronization in GenericStatement
> ------------------------------------------
>
>                 Key: DERBY-4724
>                 URL: https://issues.apache.org/jira/browse/DERBY-4724
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Wendy Feng
>            Priority: Minor
>              Labels: derby_triage10_8
>
> GenericStatement has some statements in method prepMinion()  like this:
>        if (preparedStmt == null) 
> 		{
> 			if (cacheMe)
> 				preparedStmt = (GenericPreparedStatement)((GenericLanguageConnectionContext)lcc).lookupStatement(this);
> 			if (preparedStmt == null) 
> 			{
> 				preparedStmt = new GenericPreparedStatement(this);
> 			}
> 			else
> 			{
> 				foundInCache = true;
> 			}
> 		}
> 		synchronized (preparedStmt) 
> 		{
>                      ...
>                }
> It is not safe to assgine a new object to preparedStmt before synchronizing on. 
> it may results sycnchronize on two different object if the method is called concurrently
when preparedStmt =null.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message