commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luciano Leggieri (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TRANSACTION-29) NPE in OptimisticMapWrapper on concurrent commit and rollback
Date Tue, 05 Aug 2008 19:04:44 GMT

    [ https://issues.apache.org/jira/browse/TRANSACTION-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620006#action_12620006
] 

Luciano Leggieri commented on TRANSACTION-29:
---------------------------------------------

Hello,
I reproduced the steps, but couldn't get a NPE. Does it always happen? Maybe it is already
solved?

> NPE in OptimisticMapWrapper on concurrent commit and rollback
> -------------------------------------------------------------
>
>                 Key: TRANSACTION-29
>                 URL: https://issues.apache.org/jira/browse/TRANSACTION-29
>             Project: Commons Transaction
>          Issue Type: Bug
>    Affects Versions: 1.3
>         Environment: Revision: 650440
>            Reporter: Martijn Hendriks
>
> When multiple transactions for an OptimisticMapWrapper are concurrently executing, a
NPE can be thrown if one transaction is committed and one is rolled back. This can be reproduced
with the following code (based on testMulti in the OptimisticMapWrapperTest class):
>         final Map map1 = new HashMap();
>         final OptimisticMapWrapper txMap1 = (OptimisticMapWrapper) getNewWrapper(map1);
>         Thread thread1 = new Thread(new Runnable() {
>         	public void run() {
>         		txMap1.startTransaction();
>         		txMap1.put("key1", "value2");
>         		txMap1.commitTransaction();
>             }
>         }, "Thread1");
>         txMap1.put("key1", "value1");
>         txMap1.startTransaction();
>         thread1.start();
>         txMap1.rollbackTransaction();
> * Set breakpoints at line 363 and 137 in OptimisticMapWrapper
> * Run the code above with the debugger attached
> * Step through the dispose method (release the lock)
> * Continue the other thread; it will give the NPE

-- 
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