[jboss-user] [JBoss Cache: Core Edition] - Re: JBoss Cache Issue

2008-07-16 Thread RahulKumarC
TreeCache is a tree-structured, replicated, transactional cache from JBoss 
Cache.

Being a transactional cache the state of the object in the cache should not be 
changed until we call cache.put method which should be part of the transaction 
and transaction is successful.

Where as we pass the object reference from the service-tier to web-tier and 
state of the object is changed in the web-tier transaction where the tree cache 
is not a part of it and the state of the object changes in the cache also.

Is this expected behavior?





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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164826
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Cache: Core Edition] - Re: JBoss Cache Issue

2008-07-15 Thread RahulKumarC
If you see the test case i have previous post.

I am persisting a list(l1) into cache using cache.put method and retrieving the 
list from the cache using the cache.get method and modify the state of the 
object. The modified list is NOT persisted back to the cache, but the state of 
the object in the cache is automatically getting modified even though i have 
not explicitly called the cache .put method.


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164572
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Cache: Core Edition] - JBoss Cache Issue

2008-07-10 Thread RahulKumarC
We are using jboss cache (Tree cache) to cache our objects in all our products. 
 We are facing a critical issue. After saving an object to the jboss cache 
using put method and retrieving the object from jboss cache using get method 
and changing the state of the object, the state of the object inside the jboss 
cache is also getting modified. According to the jboss cache documentation the 
state of the object inside the cache should not be modified until I call put 
method.
 
I am forwarding a test case 

Test Case


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.jboss.cache.PropertyConfigurator;
import org.jboss.cache.TreeCache;

public class TestCache {

  public static void main(String[] args) throws Exception{

List l1 = new ArrayList();
List l2 = new ArrayList();

l2.add("One");
l2.add("Two");
l2.add("Three");

l1.add(l2);

TreeCache jbossCache = null;
try {
  jbossCache = new TreeCache();
  PropertyConfigurator config = new PropertyConfigurator();
  config.configure(jbossCache, "C:\\jboss_cache.xml");
  jbossCache.startService();  
}
catch(Exception ex) {
  System.out.println(ex);
}
   
jbossCache.put("fqn", "ListInList", l1);
System.out .println("l1 : "+l1.hashCode());

   List l3 = (List) jbossCache.get("fqn","ListInList");
   System.out .println("l3 : "+l3.hashCode());

for (Iterator i = l3.iterator(); i.hasNext(); ){
  List l4 = (List) i.next();
  for (Iterator i1 = l4.iterator(); i1.hasNext(); ){
String str = (String) i1.next();
System.out .println(str);
  }
}

List l5 = (List)l3.get(0);
l5.remove(1);

List l6 = (List) jbossCache.get("fqn","ListInList");
System.out .println("l6 : "+l6.hashCode());

for (Iterator i2 = l6.iterator(); i2.hasNext(); ){
  List l7 = (List) i2.next();
  for (Iterator i3 = l7.iterator(); i3.hasNext(); ){
String str = (String) i3.next();
System.out .println(str);
  }
}
  }
}

Configuration File
-











  


  
  
  

  

jboss:service=Naming
jboss:service=TransactionManager



  org.jboss.cache.GenericTransactionManagerLookup




PESSIMISTIC


READ_COMMITTED


REPL_SYNC


false


0


0


@cache_cluster_name@




  














  




true


2


2


150




  org.jboss.cache.eviction.LRUPolicy



  
5


  5000
  1000


  5000
  1000


  5
  4


  



false

  


  
  
  
  
  




Can you please give us any solution / suggestion?

--Rahul


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163686
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user