Reputation: 836
I would like to listen to your professional advice..
Scenario]
There are two java-based application(Let say two nodes), and both has cached data. The cached data should be synchronized if the cache in one node is refreshed. For example, Tom recently got write permission on the application A, and this should be reflected in application B, too.
Challenge]
Two nodes are not cluster friendly, and the only way to communicate is via database.
Problem Statement]
How do we get a trigger from one node to initiate a cache refresh on the other node (AND without using 3rd party library due to policy)?
The one way I am currently trying is implementing DatabaseChangeListener which will be activated when there is any event (DatabaseChangeEvent). The other way I could try is polling, but I think this is not a good practice since this would produce a lot of useless threads (memory leak could occur).
Your opinion would be highly appreciated :)
Upvotes: 0
Views: 596
Reputation: 3031
I think that the best approach is to notify second cluster through network - you can use sockets for that.
If you really can't reach from one node to another (I can't see any reason for that when both nodes can see the database server) then you can use PL/SQL (or even Java in Oracle DB) to send HTTP request to your second node in trigger. For more details see: http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_http.htm
Upvotes: 1