Not the expert for mod_cluster, but in general it do a load-balancing.
From my perspective the problem is more the caching as you have one node with outdated data which is worse in case of LB and failover as well.
I would reconsider the approach and implement a mechanism to trigger a reload or better to update only the changes which are done in the DB.
Also you can use JDG as a clustered cache which might help you to have the same data within the cluster.
I forgot to mention that I'm trying to find a solution as is, meaning without any changes to the application itself.
I want such mechanism (reload trigger), that's why I was asking if mod_cluster can help in this case.
Also, I am not sure what JDG stands for.
You might have something outside of JBoss which check the node healthy and start the standby node in case of failure.
From my perspective not the best solution as you have the instance most time offline (no benefit) and there is a gap between failure and availability of the backup instance.
Also it might possible that the first node is blocked or unreachable for mod_cluster but the process is still alive.
So I would run both nodes active handling request and only have a monitoring for failure. A good monitoring tool will be JON (JBoss Operation Network) for this, it will monitor and restart the nodes if crashed.
Another option is to use the Domain mode, I suppose you use EAP6 as you post here, with that mode it is easy to administrate the configuration and a crashed node will be restarted imediatly.
For the cache sync I would recommend to implement a refresh mechanism, i.e. use a timer and check the DB data version and reload if necessary. Other option is to do it active by trigger the application if the DB has changed.
JDG stands for JBossDataGrid and is the Enterprise version of Infinispan cache
Few year back, i was in same situation.
I picked J-Groups and implemented it in our code.
1 it detect one of the node is went down in cluster.
2. If Master node is down, at receiver of Slave node, you can trigger your ORACLE Database code.
3. If required you can replicate your cache between Master and Slave. (ACTIVE-ACTIVE).
Also, J-Groups Maintenance is easy.
if require, you can use mod_jk for HTTP session stickiness (ACTIVE-ACTIVE) instead of mod_cluster.
I tried Domain mode, and I see it as the way to go. But I am still finding a way to catch a trigger of node failure. You mentioned that it can be done in Domain mode, can you please elaborate?
Also, if JBOSS clustering load balance between the nodes, then I don't think this whole thing would work out, because as I mentioned, the two nodes will then have inconsistent data (due to cache).
Unfortunately, I can not do anything to the code, the situation is going to be the same. But J-Groups do seem interesting.
Domain mode will only start the failed node. There is no trigger for other processes.
What I meant was to have both nodes in sync and under load. So you need to have a mechanism to keep both nodes in-sync