We ran into a similar problem (same situation)
Although, we happened to have an RMI connection between the tool and front-end, so we used that to send "flush" commands.
I wouldn't recommend that though, trying to keep the two synchronized was a pain.
 
Actually, I don't know much about iBATIS's caching models. Maybe someone can tell us.  Is there an easy/efficient way to make iBATIS recognize updates made by a separate process, and recache the new results?
 
My thoughts on it are that any JVM which caches through ibatis should be the only process to update the data. But, this seems too strict for real-world applications.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 21, 2006 8:08 AM
To: user-java@ibatis.apache.org
Subject: Flushing of oscache in a cluster ?

Hi there!

 

Does anyone have experience with this ?

 

As far as I have understood it, if you have one application split into two wep apps (1. out to web - 2. admin),

using Ibatis DataMapper with caching using oscache, they both have their own cache and if you have

 

    <cacheModel id="company-cache" type="OSCACHE">

        <flushInterval hours="1"/>

        <flushOnExecute statement="updateCompany"/>

    </cacheModel>

 

they don’t flush each other cache when updateCompany is run (in this case flush the web cache when a update in admin occur).

 

So far so good (?) and here comes oscache clustering  mechanism into the picture ?

 

Have anyone been able to flush each other cache when you have two web apps like we have ? What did you do ? J

 

--

 

Since the networks guys here don’t like multicasting, I have been looking at JavaGroupsBroadcastingListener with a

GossipServer or GossipRouter. Anyone experience with that togheter with Ibatis ?

 

--

 

My oscache.properties:

cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener

cache.cluster.properties=UDP(ip_mcast=false;mcast_addr=224.0.0.35;mcast_port=45566;ip_ttl=32;mcast_send_buf_size=150000;mcast_recv_buf_size=80000)

:PING(gossip_host=10.4.0.245;gossip_port=5555;gossip_refresh=15000;timeout=2000;num_initial_members=3)

 

First of all when I run the GossipServer, at once it found the first client, it’s shout down. Is that normal, trick to make it run further ? J

 

Then I tried the GossipRouter and the consol tells me that it finds the two apps/machines it supposed to do. I’m running the GossipRouter on port 5555 on machine 10.4.0.245 which

also is one of the test clients. The other test machine is 10.4.1.8.

 

--

 

Consol on the GossipRouter:

 

GossipRouter is starting...

GossipRouter started at Thu Sep 21 15:57:14 CEST 2006

Listening on port 5555 bound on address 0.0.0.0/0.0.0.0                  (Does this sound good ?)

..

DEBUG …org.jgroups.stack.GossipRouter (Line: 313) - router accepted connection from Socket[addr=/10.4.1.8,port=4463,localport=5555]

DEBUG …org.jgroups.stack.GossipRouter (Line: 524) - gossip is REGISTER_REQ group=OSCacheBus, mbr=10.4.1.8:4296

 

DEBUG …org.jgroups.stack.GossipRouter (Line: 313) - router accepted connection from Socket[addr=/10.4.0.245,port=1310,localport=5555]

DEBUG …org.jgroups.stack.GossipRouter (Line: 524) - gossip is REGISTER_REQ group=OSCacheBus, mbr=10.4.0.245:1309

 

DEBUG …org.jgroups.stack.GossipRouter (Line: 618) - running sweep

DEBUG …org.jgroups.stack.GossipRouter (Line: 618) - running sweep

…

 

 

So far it’s look good in my eyes, then I try to test to flush the cache in one app, I was expecting the cache in the other app also get flushed. NOT !!!! J

 

I don’t get any info in the GossipRouter consol, saying, got a flush command or something, should I ? The cache get flushed on the machine that send

the flush of course, but does anyone have any clues of what I can do to make the flush clustering mechanism  to work ? should I use JMS ?

 

Links to OSCACHE clusterings documentation:

http://www.opensymphony.com/oscache/wiki/Clustering.html

 

How to not using multicasting:

http://www.jgroups.org/newuser/node66.html

 

http://www.jdocs.com/jgroups/2.2.6/api/org/jgroups/stack/GossipRouter.html

 

You have any useful links ?

 

--

 

So does anyone have any clues on what I should look at, do  ????? J

 

 

Thanks a lot !!!!

 

 

Best regards,

Erlend Bjørge

Reply via email to