1 2 Previous Next 26 Replies Latest reply on Jul 17, 2004 1:34 PM by belaban Go to original post
      • 15. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
        belaban

         

        "mplesser" wrote:

        You're right sorry, i just double checked again, although it is readable from the local instance outside of the transaction.


        By other threads ? No, they are blocked unless the isolation level is NONE or READ_UNCOMMITTED (we use r/w locks here)


        It does, but only if you are using it inside of JBoss. This is an issue though if used in another Application Server - only workaround for me was to declare a Logger inside TreeCache.java.


        I'll fix this


        I had a chance only to test it with OC4J and JBoss (cvs jboss-head) so far and it works.


        Thanks


        it happens on a put(String,String,Vector) and only during the 'startup phase'. I use a maybe odd concept here:
        Whenever the coordinator receives a view-change from jgroups he issues a (rpc) method call via jgroups to all members in the cluster.


        I hope you don't use a synchronous group RPC out of the viewChange() callback. This might lead to a distributed deadlock. viewChange() actions are supposed to be short-lived, or have to run in a separate thread.

        Yes, this could be an initialization issue - apparently the interceptor chain has not yet been fully initialized.



        • 16. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
          belaban

           


          It does, but only if you are using it inside of JBoss. This is an issue though if used in another Application Server - only workaround for me was to declare a Logger inside TreeCache.java.


          Actually, this works correctly: all constructors of TreeCache call super(), which invokes the MBeanSupport constructor which creates the log.
          I just tested this outside the JBoss container.

          So what exactly doesn't work for you ?

          Bela

          • 17. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
            mplesser

            It doesnt work to filter out the log messages in TreeCache using log4j.
            If i set a category "org.jboss.cache" to say "WARN" then the TreeCache ignores that level and still logs all the "INFO" messages. This is because TreeCache is derived from ServiceMBeanSupport which is defined in package "org.jboss.system" and thus is using the Logger declared in ServiceMBeanSupport which is declared protected.
            This causes confusion since you'd have to configure a category for "org.jboss.system" in log4j to control the log level of the TreeCache.

            -markus

            • 18. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
              mplesser

               

              By other threads ? No, they are blocked unless the isolation level is NONE or READ_UNCOMMITTED (we use r/w locks here)

              From within the same thread, isolation level is REPEATABLE_READ. I add a listener to the cache which performs a get() operation on the cache on a nodeModified() event. This might of course look for the cache to appear within the same TX and may not be fixable. Only option i could think of is using a backing cache or add a method to the cache that signals if it is in an uncommited TX state.


              I hope you don't use a synchronous group RPC out of the viewChange() callback. This might lead to a distributed deadlock. viewChange() actions are supposed to be short-lived, or have to run in a separate thread.

              No, this is done in an asynchronous manner with callbacks.
              I 'have' to do it that way since i can not add user defined properties to Address objects used by jgroups and have them replicated to the other nodes. Else each node could add a property to its own address for other nodes to read them. IF there is a way to do so already i just haven't found it out yet :)


              Yes, this could be an initialization issue - apparently the interceptor chain has not yet been fully initialized.

              Seems so - maybe add some checks here or buffer the operation till it is set up?

              • 19. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                belaban

                 

                "mplesser" wrote:
                It doesnt work to filter out the log messages in TreeCache using log4j.
                If i set a category "org.jboss.cache" to say "WARN" then the TreeCache ignores that level and still logs all the "INFO" messages. This is because TreeCache is derived from ServiceMBeanSupport which is defined in package "org.jboss.system" and thus is using the Logger declared in ServiceMBeanSupport which is declared protected.
                This causes confusion since you'd have to configure a category for "org.jboss.system" in log4j to control the log level of the TreeCache.

                -markus


                When the logger is created, we use getClass() which returns TreeCache.class and *not* ServiceMBeanSupport.class ! So logging works, just tested again with INFO and WARN. Maybe you're picking up the wrong log4j.props ? Do you use -Dlog4j.configuration, eg.

                -Dlog4j.configuration=file:c:\log4j.properties ?

                Bela

                • 20. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                  belaban

                   

                  "mplesser" wrote:

                  From within the same thread, isolation level is REPEATABLE_READ. I add a listener to the cache which performs a get() operation on the cache on a nodeModified() event. This might of course look for the cache to appear within the same TX and may not be fixable. Only option i could think of is using a backing cache or add a method to the cache that signals if it is in an uncommited TX state.


                  The same thread will of course see its changes made in the same TX. Only other threads are blocked. This is all as designed.



                  No, this is done in an asynchronous manner with callbacks.
                  I 'have' to do it that way since i can not add user defined properties to Address objects used by jgroups and have them replicated to the other nodes. Else each node could add a property to its own address for other nodes to read them. IF there is a way to do so already i just haven't found it out yet :)


                  There is :-) Have a look at ClusterPartition.startService() and search for the CONFIG event. You can set some user-defined bytes in an IpAddress, using {set,get}AdditionalData().


                  Seems so - maybe add some checks here or buffer the operation till it is set up?


                  Do you have a small test case that reproduces the problem ?

                  Bela

                  • 21. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                    mplesser

                     

                    When the logger is created, we use getClass() which returns TreeCache.class and *not* ServiceMBeanSupport.class ! So logging works, just tested again with INFO and WARN. Maybe you're picking up the wrong log4j.props ? Do you use -Dlog4j.configuration, eg.

                    -Dlog4j.configuration=file:c:\log4j.properties ?

                    I'm picking up the correct log4j.xml but it seems this is a more complex problem than i thought - I have to derive my own class from TreeCache to be able to use RPC calls - maybe here is my problem located, i'll have to dig into this further.

                    The same thread will of course see its changes made in the same TX. Only other threads are blocked. This is all as designed.

                    Hmm makes it hard - maybe you could think of adding a method that tells the user if the cache is in an uncommited transaction?

                    Do you have a small test case that reproduces the problem ?

                    Actually not really - the test case i use is part of a rather complex framework and can not easily be separated (I use lots of wrappers and have a lot of dependecies but i'll see if i can produce a simple test case).

                    There is :-) Have a look at ClusterPartition.startService() and search for the CONFIG event. You can set some user-defined bytes in an IpAddress, using {set,get}AdditionalData().

                    Took me a while to figure out that you are talking about the jboss clustering classes :)
                    I tried it but it seems that it doesn't work once the channel is connected. I do get access to the channel by using a class that is derived from TreeCache but the creation of the channel is immediatly followed by a connect in the startService()-method if TreeCache.

                    My suggestion would be to apply this patch to TreeCache (current cvs head):
                    200c200
                    <
                    ---
                    > protected HashMap channelConfig=null;
                    1000a1001,1009
                    > /**
                    > * Set configuration options for JChannel, that are passed
                    > * down as a CONFIG event upon connection.
                    > * @param channelConfig configuration options for the channel
                    > */
                    > public void setChannelConfig(HashMap channelConfig) {
                    > this.channelConfig=channelConfig;
                    > }
                    >
                    1053a1063,1066
                    > if( channelConfig != null ) {
                    > channel.down(new org.jgroups.Event(org.jgroups.Event.CONFIG, channelConfig));
                    > channel.getProtocolStack().flushEvents();
                    > }
                    


                    This adds a setChannelConfig() method where a HashMap can be supplied that is passed down the channel right before it connects.

                    -markus



                    • 22. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                      belaban

                       

                      "mplesser" wrote:

                      Hmm makes it hard - maybe you could think of adding a method that tells the user if the cache is in an uncommited transaction?


                      TransactionManager.getTransaction().getStatus()



                      Took me a while to figure out that you are talking about the jboss clustering classes :)


                      ctrl-n in IntelliJ IDEA, or similar stuff in eclipse


                      I tried it but it seems that it doesn't work once the channel is connected. I do get access to the channel by using a class that is derived from TreeCache but the creation of the channel is immediatly followed by a connect in the startService()-method if TreeCache.

                      My suggestion would be to apply this patch to TreeCache (current cvs head):

                      This adds a setChannelConfig() method where a HashMap can be supplied that is passed down the channel right before it connects.


                      Negative. I don't want to expose the Channel any more than it currently is; as a matter of fact, replication will all be moved into the ReplicationInterceptor, and I also want to be able to use ClusterPartition (like other clustering services).

                      So the method you suggest would have to be removed 6 months down the road anyway.

                      Suggestion: why don't you override startService() in your subclass ?

                      Bela


                      • 23. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                        mplesser

                         

                        "bela" wrote:

                        Suggestion: why don't you override startService() in your subclass ?

                        Thanks for your input and i actually would if i could - but since createCacheLoader(), fetchStateOnStartup(), determineCoordinator() and createInterceptorChain() are not declared public and are inaccessible from a derived class i can't :(

                        -markus

                        • 24. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                          belaban

                          Made those methods protected, so go and override startService()

                          Bela

                          • 25. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                            mplesser

                            Thanks a lot again :)

                            I can now finally confirm that the TX-lookups work under WebSphere 5.1 !
                            (And you can't imagine how i hate WebSphere by now ....)

                            • 26. Re: Using JBossCache with WebLogic 8.1 and WebSphere 5.1
                              belaban

                              good !

                              1 2 Previous Next