|
From: <bst...@jb...> - 2006-06-22 23:47:06
|
I mentioned before that I found another problem that seems to call for the use of a flat heap.
See unit test o.j.c.buddyreplication.aop.BuddyReplicationFailoverTest. This test currently fails due to JBCACHE-669, but even if 669 were resolved the test would still fail due to the following problem:
2 Person objects, with a shared reference to an Address. Using buddy replication.
1 Person is placed in Cache 1 under "/husband" then the other is placed in Cache 1 under "/wife". The address is stored in "/husband/address" -- "/wife/address" just has an indirect pointer to "/husband/address".
Cache 1 dies. User fails over to Cache 2.
1) User calls getObject("/wife").
2) This causes node's "/wife" and "/wife/address" to gravitate.
3) User call wife.getAddress().
4) JBCACHE-669 is fixed, so this causes "/_JBossInternal_/_RefMap_/husband_address" to gravitate.
5) PojoCache deferences and follows the RefMap entry to "/husband/address", so node "/husband/address" is gravitated.
6) Gravitating "/husband/address" *does not cause the data map of "/husband" to gravitate*!!! Rather, Cache 2 just creates an empty node at "/husband" to maintain the tree structure.
7) User calls getObject("/husband"). This returns null, because node "/husband" does not have any data. No data gravitation is performed, because the "/husband" node *exists* in Cache 2.
The fundamental problem here is the intermingling of the TreeCache structure with the storage of data. You can't access the Address object without involving the concept of "husband", which leads to all sorts of problems.
BTW, I don't think this particular issue has to be fixed for 1.4.0 -- we could just say BR is for plain cache operations. However, JBCACHE-669 does need to be fixed, as FIELD replication does not work correctly without it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3952840#3952840
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3952840
|