]
Nikolay Shestakov updated JBCACHE-1551:
---------------------------------------
Attachment: SuspendTxTest.java
this is test for reproduce this problem.
Locking parent node?
--------------------
Key: JBCACHE-1551
URL:
https://jira.jboss.org/jira/browse/JBCACHE-1551
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Locking
Affects Versions: 3.2.0.GA, 3.2.1.GA
Reporter: Nikolay Shestakov
Assignee: Manik Surtani
Attachments: SuspendTxTest.java
I have next test:
@Test
public void nodes()
{
// setup
Fqn<String> fqn1 =
Fqn.fromElements(UUID.randomUUID().toString().replace("-", ""));
String attribute1 = UUID.randomUUID().toString().replace("-",
"");
String value1 = UUID.randomUUID().toString().replace("-",
"");
Fqn<String> fqn2 =
Fqn.fromElements(UUID.randomUUID().toString().replace("-", ""));
String attribute2 = UUID.randomUUID().toString().replace("-",
"");
String value2 = UUID.randomUUID().toString().replace("-",
"");
Assert.assertFalse(fqn1.equals(fqn2));
// call
TransactionHelper.begin();
_cache.put(fqn1, attribute1, value1);
TransactionHelper.begin(); // suspend and begin new
_cache.put(fqn2, attribute2, value2);
TransactionHelper.commit();
TransactionHelper.commit();
// assertions
Assert.assertEquals(value1, _cache.get(fqn1, attribute1));
Assert.assertEquals(value2, _cache.get(fqn2, attribute2));
// clear
}
sometimes this test is fail (~ one time from 1000 executions):
Unable to acquire lock on Fqn [/test19cb7eae7cc546b1909261c289] after [10000]
milliseconds for requestor [GlobalTransaction:<null>:3]! Lock held by
[GlobalTransaction:<null>:2]
at org.jboss.cache.mvcc.MVCCNodeHelper.acquireLock(MVCCNodeHelper.java:159)
at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:236)
at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:186)
at
org.jboss.cache.interceptors.MVCCLockingInterceptor.handlePutKeyValueCommand(MVCCLockingInterceptor.java:101)
at
org.jboss.cache.interceptors.base.PrePostProcessingCommandInterceptor.visitPutKeyValueCommand(PrePostProcessingCommandInterceptor.java:88)
at
org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at
org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
at
org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)
at
org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at
org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)
at org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:283)
at
org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)
at
org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at
org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.jboss.cache.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:119)
at
org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at
org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
at
org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
at
org.jboss.cache.interceptors.InvocationContextInterceptor.visitPutKeyValueCommand(InvocationContextInterceptor.java:82)
at
org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)
at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
at
org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:555)
config file is:
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.2">
<transaction
transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
/>
<locking
isolationLevel="REPEATABLE_READ"
lockParentForChildInsertRemove="false"
nodeLockingScheme="mvcc" />
<jmxStatistics
enabled="true" />
</jbosscache>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: