简体   繁体   中英

Weblogic clustering

Our Application in production runs on weblogic. It is a spring and struts based web application. There is a requirement to db load the queries and a capability to reload on the fly through a GUI handle. Some of the existing utility files are not configured as a bean in spring (cannot be at this point) and are having static methods which use the static variables/constants for the query to be run in each of those static methods. I dont understand how Weblogic cluster will behave if I have to reload the queries from DB while app is up and running. To put the question in other words, how do we ensure that reload of queries on the static variables happen on all the JVMs so that next hit on the method on any node will fetch the result of the newly loaded query?

Lets see if this answers your query.

If you have 3 managed servers and you have deployed your Spring app across all the 3 managed servers then spring will bring up 3 application contexts. (one for each managed server).

They do not talk to each other, They will run within their own server. They will have their own set of beans and their own static variables.

So the reload on one server will be for that server. You will have to reload the static stuff on all the three servers to get it reflected across the entire application.

If you want one reload to be ok for all then use properties file (or any other resource that all the 3 managed servers can share from the same location, Like JNDI for admin server, property file stored on file system, store your queries in some DB Table and load it from there - provided all apps point to the same database)

Each WebLogic managed server will have its own Spring application context (as Vivek described).

One way of ensuring each JVM has a refreshed set of "db queries" is to use a shared, distributed cache (eg ehcache) so that your data is refreshed regardless of which node made the refresh. Distributed caching and cache replication is a complex solution to your issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM