So you want to use JBoss clustering to replicate the xml around the cluster, and then update local copies of the DB when state changes?
Two vague options, both involving JBoss Cache: 1) Use JBossCache as a write-aside cache. I.e. if the app wants to read data, check the cache first; if found use it. If not, read from db and put in cache. If app wants to write data, put in cache first then write to db. Create an implementation of TreeCacheListener and register it with the cache. You will get notifications when nodes in the cache are changed. Ignore notifications that are caused by your own local activity (use a ThreadLocal to flag that the thread is doing local activity. Pay attention to notifications not due to local activity; these mean state was changed on another server. Read the updated state from the cache and write it to the local DB. 2) Use JBossCache as a write-through cache, with a CacheLoader targetting the DB. Your app only deals with the JBossCache instance. If data is not in the cache, the call goes through the cache loader to the DB to get the data and load it into the cache. If data is placed into the cache, it is also written to the DB. When data is replicated from another server, the new data is also written to the DB. Advantage of #2 is it is simpler. But the existing CacheLoader implementations use a very primitive database schema to store the data. If you wanted complex mapping of data, or your database doesn't support JDBC you'd need your own CacheLoader implementation. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947002#3947002 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947002 ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
