0 Replies Latest reply on Mar 12, 2007 1:19 PM by Bob Ninja

    Bean replication is incomplete

    Bob Ninja Newbie

      I apologize in advance if this is a stupid question and I just missed an important detail. I am staring at the code for hours and just don't see the solution. Don't know if it is a bug, so posting here.

      WinXP, 1.4.1.SP2 "Cayenne"

      I have a simple bean,

      public class Participant implements java.io.Serializable

      That has a bunch of strings/longs and a couple of enumerations. As far as I can see, the bean class and enums are being AOPed fine. I have 2 test program instances on the same machine (the usual mcast UDP JGroups sync repl config). I have one instance add 10 random beans, other sit there and listen. I printed the tree cache events to verify replication:

      >>>>>> CREATED //participant/4652685174939582464

      read locked=true
      write locked=false
      >>>>>> MODIFIED //participant/4652685174939582464

      read locked=false
      write locked=true
      >>>>>> MODIFIED //participant/4652685174939582464

      data={sessionToken=-92365483700473427, calledPartyId=-92365483700473427, statusModified=5204802195775329777, callingPartyId=-92365483700473427, sysId=4652685174939582464, _lock_=LOCK, __jboss:internal:class__=class test.ubiquity.speak.cache.beans.Participant, serviceToken=-92365483700473427, AOPInstance=org.jboss.cache.aop.AOPInstance@4ee70b, emailComment="7OHN0, activeTalkerId=-92365483700473427, codes=0, userConfigId=5204802195775329777, phoneSequenceNumber=0, passcode=5204802195775329777, emailHostEventDispatch=0, phoneNumber=hmE)hm$*pWAg=<, originatorId=5204802195775329777, name=Elizabeth Smith}
      read locked=false
      write locked=true
      >>>>>> MODIFIED //participant/4652685174939582464/status

      data={__SERIALIZED__=Connecting to conference, __jboss:internal:class__=class test.ubiquity.speak.cache.beans.ParticipantStatus, AOPInstance=org.jboss.cache.aop.AOPInstance@77ef83}
      read locked=false
      write locked=true
      >>>>>> MODIFIED //participant/4652685174939582464/participationStatus

      data={__SERIALIZED__=Tentative, __jboss:internal:class__=class test.ubiquity.speak.cache.beans.ParticipationStatus, AOPInstance=org.jboss.cache.aop.AOPInstance@1cb52ae}
      read locked=false
      write locked=true

      Later on (about 10 secs later) I scan the cache in the program instance which was passive, only waiting and listening.

      >>>>>>>>>>>>>>>> FOUND for //participant/4652685174939582464
      >>>> //participant/4652685174939582464/participationStatus = Tentative
      >>>> //participant/4652685174939582464/status = Connecting to conference

      I find the enumeration objects, but not the bean itself????
      Next I scan the tree cache to see what is in the node:

      Node contents: {sessionToken=-4160719232651749702, statusModified=-5317723505947260726, calledPartyId=-4160719232651749702, _lock_=LOCK, sysId=7782123300288724992, callingPartyId=-4160719232651749702, serviceToken=-4160719232651749702, __jboss:internal:class__=class test.ubiquity.speak.cache.beans.Participant, AOPInstance=org.jboss.cache.aop.AOPInstance@4ee70b, activeTalkerId=-4160719232651749702, emailComment=.+DU_, codes=0, phoneSequenceNumber=0, userConfigId=-5317723505947260726, passcode=-5317723505947260726, emailHostEventDispatch=0, phoneNumber=cRGHr=x!WS, originatorId=-5317723505947260726, name=Joe Moe}
      Node lock: unlocked
      Node contents: {__SERIALIZED__=Connecting to conference, __jboss:internal:class__=class test.ubiquity.speak.cache.beans.ParticipantStatus, AOPInstance=org.jboss.cache.aop.AOPInstance@77ef83}
      Node lock: unlocked
      Node contents: {__SERIALIZED__=Tentative, __jboss:internal:class__=class test.ubiquity.speak.cache.beans.ParticipationStatus, AOPInstance=org.jboss.cache.aop.AOPInstance@1cb52ae}
      Node lock: unlocked

      1st is the bean, 2nd and 3rd are children nodes for enums. Again everyting looks fine. The only delta I can discern is the:
      " _lock_=LOCK" entry in the bean node that is not present in enums.
      So I went back and printed lock status. Seems all nodes are unlocked, as expected.

      The code that adds beans is simple:

      DummyTransactionManager txMgr = DummyTransactionManager.getInstance();
      DummyUserTransaction tx =null;
      for (int index=0; index < SAMPLE_DATA_SIZE; index++) {
      bean = Participant.createRandomBean();
      tx = new DummyUserTransaction( txMgr );
      cache.putObject(new Fqn(PARTICIPANT_ROOT, bean.getSysId()), bean);

      The program instance that creates beans has no issues accessing them. It is only the other instance which gets beans via replication that cannot see them in the cache.

      For brevity I skipped most of the code and config, so let me know if you need more. I am guessing that I missed an important detail, but cannot see what it is. I would assume that after a successful commit all locks are released and bean is available for access on any node. Don't know why is this "LOCK" entry left in the bean node.