wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes How to propogate Configuration changes to different servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to propogate Configuration changes to different servers" Watch "How to propogate Configuration changes to different servers" New topic
Author

How to propogate Configuration changes to different servers

anilkumar potu
Greenhorn

Joined: Dec 11, 2008
Posts: 15
Hi,

I have a situation where in i will make changes to Database in one server but those changes need to be propogated to other application servers connecting to same database. Servers should know that Database has changed and they need to refresh their data automatically.

we at AT&T use tomcat servers and oracle with struts2 framework.
Can i get some help on this please?

Thanks
Anil
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
What kind of changes does the database go through? Just data updates or something else?
anilkumar potu
Greenhorn

Joined: Dec 11, 2008
Posts: 15
We have application level configurations in database and if we change them they need to be updated for all servers which are running in different machines but connecting to same DB automatically. DB changes will be data/Strings.

Anil
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
How frequent the data will be refreshed?

How about going for Scheduler APIs like Quatrz?

In our case, we dont have frequent config changes, so we restart the application whenever required.
anilkumar potu
Greenhorn

Joined: Dec 11, 2008
Posts: 15
Yeah for us too changes will not be so frequent but if they change requirement is that Users should not know that there is a change and it should be under wraps. thought of using Quartz but we have some restrictions on that.
Thought of using openMQ to send message to servers once db update happens and they should read it and should update them selfs but not sure how feasible it is.
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
MQ is used effectively across different areas, given your case I am not sure if Database can automatically trigger a process (but DBAs can help in this), that would refresh your application.

If DB cannot trigger a Java process,
1. it is easy restart the application to get the latest.
2. Post a message to a queue through a client
3. Have a job that runs on a schedule.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

I have a situation where in i will make changes to Database in one server but those changes need to be propogated to other application servers connecting to same database. Servers should know that Database has changed and they need to refresh their data automatically.


So this data is read once and then cached on the application? Use a Topic to propagate the data change.
Post to a topic on a JMS server and have an mdb on each server listening to the topic.
The MDBs react to receiving the message by forcing a reload of the db cache.
It's a common enough pattern.

ram.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

Shinelin Samuel wrote:2. Post a message to a queue through a client


It has to be a topic to be received by all the servers in the cluster.

ram.
anilkumar potu
Greenhorn

Joined: Dec 11, 2008
Posts: 15
As my application runs on tomcat i cant use MDB's. And i cant restart my application as it is against my requirement.
So very limited options for me. Any ideas of invoking URL from oracle triggers?
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
I am not an expert in Oracle
anyways, I googled something for you, Hope this helps..

http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm
http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chone.htm
anilkumar potu
Greenhorn

Joined: Dec 11, 2008
Posts: 15
Thanks Guys for your replies. I got a work around. We are going to use wget URL to invoke application from database trigger which will take care of populating those data background.

Thanks for your time.

Anil
anilkumar potu
Greenhorn

Joined: Dec 11, 2008
Posts: 15
Another solution will be have this code to call specific URL's

URL url;
InputStream inputStream = null;
DataInputStream dataInputStream;
String inputLine;
url = new URL("http:/........");
inputStream = url.openStream();
dataInputStream = new DataInputStream(new BufferedInputStream(inputStream));
while ((inputLine = dataInputStream.readLine()) != null)
{
System.out.println(inputLine);
}
That works

Thanks
Anil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to propogate Configuration changes to different servers