We're currently using JBossCache 1.2.3. When running the following test code we 
experienced that the last test case marked with THIS FAILS causes a problem.
  public void testSimpleRollbackTransactions() throws Exception {
  |     TreeCache firstCache = new TreeCache();
  |     firstCache.setTransactionManagerLookup(new 
DummyTransactionManagerLookup());
  |     firstCache.start();
  |     UserTransaction tx = new 
DummyUserTransaction(DummyTransactionManager.getInstance());
  |     tx.begin();
  | 
  |       firstCache.put("/testNode/node1/first", "entry", "commit");
  | 
  |     tx.commit();
  |     
  |     tx = new DummyUserTransaction(DummyTransactionManager.getInstance());
  |     tx.begin();
  | 
  |       firstCache.put("/testNode/node1/first", "entry", "rollback");
  |       firstCache.remove("/testNode/node1/first");
  | 
  |     tx.rollback();
  | 
  |     assertEquals("Node should keep the commited value", "commit", 
firstCache.get("/testNode/node1/first").get("entry"));
  |     
  |     tx = new DummyUserTransaction(DummyTransactionManager.getInstance());
  |     tx.begin();
  | 
  |       firstCache.remove("/testNode/node1/first");
  |       firstCache.put("/testNode/node1/first", "entry", "rollback");
  | 
  |     tx.rollback();
  | 
  |     assertEquals("Node should keep the commited value", "commit", 
firstCache.get("/testNode/node1/first").get("entry"));  // THIS FAILS
  |   }
  | 

After having a look at the source code the problem seems to be that the put 
creates the node from new and it gets therefore added to the node list of the 
transaction entry. In the rollback case the LockInterceptor removes all these 
temporay nodes and it therefore vanishes from the cache which is not what we 
expected. The question is now is there any workaround for this or does the 
1.2.4 relase fix this problem (I haven't found it in the release notes so I 
assumed it does not fix it).

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3906766#3906766

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3906766


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to