posted 11 years ago
There are confusions.
Who receives the input; load balancer or both the instance?If load balancer receives it and delegates to one of the instance, then is not the whole question becomes pointless?If both the instance receives the input, then what the load balancer is for?
In a typical clustered environment the request actually comes to the load balancer and gets delegated to a specific instance bearing minimal load at current time. Therefore if a load balancer is in place, then the whole given scenario becomes useless, since the situation can never occur!!
If there is no load balancer and request comes to both the instances, only then the question makes sense. In such a scenario, the best choice would be to use JMX communication between two instances to sync up and decide who will handle the persistence operation.
You just need to know where to find it!!