This content has been marked as final.
Show 8 replies
-
1. Re: FileCacheLoader partial preload
emailmsgbox Dec 10, 2006 11:13 AM (in response to emailmsgbox)the same goes for an ArrayList
myArrayList.size() = 0; myArrayList.toArray() is an empty ArrayList but myArrayList.get(0) returns an Object
why? -
2. Re: FileCacheLoader partial preload
brian.stansberry Dec 11, 2006 12:55 PM (in response to emailmsgbox)Are you using PojoCache here? I assume yes, but you don't say this.
-
3. Re: FileCacheLoader partial preload
emailmsgbox Dec 18, 2006 5:38 AM (in response to emailmsgbox)I'm using POJO cache
this is a test code@PojoCacheable public class TestData implements Serializable { Map<Integer,TestKukuData> kukuMap = new HashMap<Integer,TestKukuData>(); String myStr; int myInt; public TestData() { } public TestData(String myStr, int myInt) { this.myStr = myStr; this.myInt = myInt; } public Map<Integer, TestKukuData> getKukuMap() { return kukuMap; } public void setKukuMap(Map<Integer, TestKukuData> kukuMap) { this.kukuMap = kukuMap; } }
PojoCacheable public class TestKukuData implements Serializable { String id; int miInt; public TestKukuData() { } public TestKukuData(String id, int miInt) { this.id = id; this.miInt = miInt; } public String getId() { return id; } public void setId(String id) { this.id = id; } }
public class MYCache { final static Fqn TEST = Fqn.fromString("/kuku/test"); static PojoCacheIfc myCache; .... public static TestData setTest(Integer id, TestData data){ return (TestData)myCache.putObject(new Fqn(TEST,id),data); } public static TestData getTest(Integer id){ return (TestData)myCache.getObject(new Fqn(TEST,id)); }
class MainTest{ public void do(){ int id = 1234 TestData tData = MYCache.getTest(id); if(tData == null){ TestData data = new TestData("TestData",1); data.getKukuMap().put(new Integer(11),new TestKukuData("kukuID1",1+id)); data.getKukuMap().put(new Integer(22),new TestKukuData("kukuID2",2+id)); MYCache.setTest(id,data); } else{ int size = tData.getKukuMap.size(); Collection c = tData.getKukuMap.values() ; TestKukuData kuku = (TestKukuData )ttData.getKukuMap.getObject(11) } }
I run this twice
first time I load the cache , then I restart Jboss
the second time size is 0 and the collection is empty
but kuku is with the right value
what am I missing ? -
4. Re: FileCacheLoader partial preload
brian.stansberry Dec 18, 2006 11:03 AM (in response to emailmsgbox)This sounds like a bug. Can you create a test case from this and open a JIRA?
-
5. Re: FileCacheLoader partial preload
emailmsgbox Dec 18, 2006 11:31 AM (in response to emailmsgbox)where and and how do I open a JIRA?
-
6. Re: FileCacheLoader partial preload
brian.stansberry Dec 18, 2006 12:07 PM (in response to emailmsgbox)http://jira.jboss.com. "Create New Issue" link. Choose the JBoss Cache project from the pull down.[/url]
-
7. Re: FileCacheLoader partial preload
emailmsgbox Dec 20, 2006 4:22 AM (in response to emailmsgbox)I've opened a bug request
http://jira.jboss.com/jira/browse/JBCACHE-909 -
8. Re: FileCacheLoader partial preload
ben.wang Jan 2, 2007 2:50 AM (in response to emailmsgbox)Should have this fixed in post 1.4.1.CR1. Please check it out.