On 11 May 2009, at 06:55, Mircea Markus wrote:
Hi Manik,
In the following modified version of NodeAPITest.testAddingDataTx,
the output will be "false" (the version here is slightly modified).
public void testAddingDataTx() throws Exception {
Node<Object, Object> rootNode = cache.getRoot();
tm.begin();
Node<Object, Object> nodeA = rootNode.addChild(A);
NodeKey dataKey = new NodeKey(Fqn.fromString("/a"),
NodeKey.Type.DATA);
System.out.println("is it locked???" +
cache
.getCache
().getAdvancedCache
().getInvocationContextContainer().get().hasLockedKey(dataKey));
nodeA.put("key", "value");
assertEquals("value", nodeA.get("key"));
tm.commit();
}
Now, after creating a node within a tx, shouldn't the corresponding
dataKey have a WL? (i.e. the code to print "true").
The data key should not be locked when you are adding a child. Now if
you tested this after NodeA.put(), then it should print "true".
Cheers
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org