7 Replies Latest reply on Nov 15, 2005 1:07 AM by Ben Wang

    Obtaining a newly added POJO in TreeCacheAop

    Richard Smol Newbie

      Is there any easy way to obtain a newly created POJO, without getting into all kinds of hairy locking-problems? I am especially talking about obtaining a POJO after catching a nodeCreated or nodeLoaded-event...

        • 1. Re: Obtaining a newly added POJO in TreeCacheAop
          Ben Wang Master

          Can't getObject do the trick. It is only read lock on one paticular node and it is quick (since it will just return the object instance).

          -ben

          • 2. Re: Obtaining a newly added POJO in TreeCacheAop
            Richard Smol Newbie

             

            "ben.wang@jboss.com" wrote:
            Can't getObject do the trick. It is only read lock on one paticular node and it is quick (since it will just return the object instance).

            -ben


            No. When I try a getObject(), I get a stacktrace like this:


            javax.transaction.RollbackException
             at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:67)
             at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:60)
             at org.jboss.cache.aop.TreeCacheAop.endTransaction(TreeCacheAop.java:483)
             at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:373)
             at nl.motormind.server.TblServerRmt.initialize(TblServerRmt.java:407)
             at nl.motormind.server.TblServerRmt.<init>(TblServerRmt.java:209)
             at nl.motormind.server.TblServer.main(TblServer.java:18)
             at nl.motormind.test.StartAll.main(Unknown Source)11:44:51,468 Feed node created: /feeds, object null [ Thread-32] INFO titaan.tbl.server.TblServerRmt 08 Nov 2005 11:44:51,468
            
            org.jboss.util.NestedRuntimeException: TreeCacheAop.endTransaction(): ; - nested throwable: (javax.transaction.RollbackException)
             at org.jboss.cache.aop.TreeCacheAop.endTransaction(TreeCacheAop.java:490)
             at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:373)
             at nl.motormind.server.TblServerRmt.initialize(TblServerRmt.java:407)
             at nl.motormind.server.TblServerRmt.<init>(TblServerRmt.java:209)
             at nl.motormind.server.TblServer.main(TblServer.java:18)
             at nl.motormind.test.StartAll.main(Unknown Source)
            Caused by: javax.transaction.RollbackException
             at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:67)
             at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:60)
             at org.jboss.cache.aop.TreeCacheAop.endTransaction(TreeCacheAop.java:483)
             ... 5 more
            


            • 3. Re: Obtaining a newly added POJO in TreeCacheAop
              Richard Smol Newbie

              I tried to postpone reading the object until I get the first Modification-event, but then I get this stacktrace:

              14:10:07 runPreparePhase() failed. Transaction is marked as rolled back [ Thread-53] WARN ceptors.ReplicationInterceptor 08 Nov 2005 14:10:07,609
              org.jboss.cache.ReplicationException: rsp=sender=10.220.242.154:3044, retval=null, received=false, suspected=false
               at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:3505)
               at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:3526)
               at org.jboss.cache.interceptors.ReplicationInterceptor.runPreparePhase(ReplicationInterceptor.java:485)
               at org.jboss.cache.interceptors.ReplicationInterceptor$SynchronizationHandler.beforeCompletion(ReplicationInterceptor.java:389)
               at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:72)
               at org.jboss.cache.transaction.DummyTransaction.notifyBeforeCompletion(DummyTransaction.java:239)
               at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:54)
               at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:60)
               at org.jboss.cache.aop.TreeCacheAop.endTransaction(TreeCacheAop.java:483)
               at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:373)
               at org.jboss.cache.aop.collection.CachedMapImpl.put(CachedMapImpl.java:66)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               at org.jboss.cache.aop.collection.CollectionInterceptorUtil.invoke(CollectionInterceptorUtil.java:122)
               at org.jboss.cache.aop.collection.CachedMapInterceptor.invoke(CachedMapInterceptor.java:108)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
               at AOPClassProxy$0.put(AOPClassProxy$0.java)
               at nl.motormind.server.TblServerRmt.addCyrusMessage(TblServerRmt.java:708)
               at nl.motormind.server.TblServerRmt$1.messageReceived(TblServerRmt.java:397)
               at nl.motormind.server.communication.FeedCommunicator.distributeMessageToListeners(Unknown Source)
               at nl.motormind.server.communication.FeedCommunicator.socketMessageReceived(Unknown Source)
               at nl.motormind.server.communication.FeedCommunicator.access$300(Unknown Source)
               at nl.motormind.server.communication.FeedCommunicator$ClientThread.run(Unknown Source)
              14:10:07 beforeCompletion() failed for tx=org.jboss.cache.transaction.DummyTransaction@309f9f, handlers=[ReplicationInterceptor(gtx=GlobalTransaction:<10.220.242.154:3048>:3, tx=org.jboss.cache.transaction.DummyTransaction@309f9f), org.jboss.cache.interceptors.PessimisticLockInterceptor$SynchronizationHandler@1d27069] [ Thread-53] ERROR e.transaction.DummyTransaction 08 Nov 2005 14:10:07,625
              org.jboss.util.NestedRuntimeException: ; - nested throwable: (org.jboss.cache.ReplicationException: rsp=sender=10.220.242.154:3044, retval=null, received=false, suspected=false)
               at org.jboss.cache.interceptors.ReplicationInterceptor$SynchronizationHandler.beforeCompletion(ReplicationInterceptor.java:406)
               at org.jboss.cache.interceptors.OrderedSynchronizationHandler.beforeCompletion(OrderedSynchronizationHandler.java:72)
               at org.jboss.cache.transaction.DummyTransaction.notifyBeforeCompletion(DummyTransaction.java:239)
               at org.jboss.cache.transaction.DummyTransaction.commit(DummyTransaction.java:54)
               at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:60)
               at org.jboss.cache.aop.TreeCacheAop.endTransaction(TreeCacheAop.java:483)
               at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:373)
               at org.jboss.cache.aop.collection.CachedMapImpl.put(CachedMapImpl.java:66)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               at org.jboss.cache.aop.collection.CollectionInterceptorUtil.invoke(CollectionInterceptorUtil.java:122)
               at org.jboss.cache.aop.collection.CachedMapInterceptor.invoke(CachedMapInterceptor.java:108)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
               at AOPClassProxy$0.put(AOPClassProxy$0.java)
               at nl.motormind.server.TblServerRmt.addCyrusMessage(TblServerRmt.java:708)
               at nl.motormind.server.TblServerRmt$1.messageReceived(TblServerRmt.java:397)
               at nl.motormind.server.communication.FeedCommunicator.distributeMessageToListeners(Unknown Source)
               at nl.motormind.server.communication.FeedCommunicator.socketMessageReceived(Unknown Source)
               at nl.motormind.server.communication.FeedCommunicator.access$300(Unknown Source)
               at nl.motormind.server.communication.FeedCommunicator$ClientThread.run(Unknown Source)
              Caused by: org.jboss.cache.ReplicationException: rsp=sender=10.220.242.154:3044, retval=null, received=false, suspected=false
               at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:3505)
               at org.jboss.cache.TreeCache.callRemoteMethods(TreeCache.java:3526)
               at org.jboss.cache.interceptors.ReplicationInterceptor.runPreparePhase(ReplicationInterceptor.java:485)
               at org.jboss.cache.interceptors.ReplicationInterceptor$SynchronizationHandler.beforeCompletion(ReplicationInterceptor.java:389)
               ... 21 more


              • 4. Re: Obtaining a newly added POJO in TreeCacheAop
                Richard Smol Newbie

                Does anyone at JBOSS have a clue about what is going wrong? I have been reporting these kinds of issues for months now and am really starting to get pressed for time, since my project needs to get finished... so any kind of input would be appreciated!

                • 5. Re: Obtaining a newly added POJO in TreeCacheAop
                  Ben Wang Master

                  Sorry, I'd like to help but I don't have a clue unless you can give me a sample test case to run.

                  Like I mentioned, we have numerous junit test cases that test getObject call. You can verify it yourslef from our 1.2.4 distro.

                  -Ben

                  • 6. Re: Obtaining a newly added POJO in TreeCacheAop
                    Brian Stansberry Master

                    Ben,

                    Sorry, at this time of night I'm being lazy and just posting instead of looking at the code, but is the problem possibly that he's getting the notification early in the process of breaking down the object into tree nodes, and calling getObject() at that point is interfering with the process?

                    • 7. Re: Obtaining a newly added POJO in TreeCacheAop
                      Ben Wang Master

                      Yes, that is possible. But I need a use case to see this otherwise it is difficult for me to troubleshoot.

                      Motormind, can't you cook up a dummy use case?

                      -Ben