This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi, I would like to know if my app is running on a Production server or a development server. Previously I was defining a variable to denote this out of Websphere as an operating system variable and referencing them using System.getEnv() in my app. But this had some drawbacks. Most of the time on a server restart, the websphere instance starts before the environment variable is declared, and websphere doesn't know about this variable.
Recently I have been reading up on variables that could be defined within Websphere (Environment, WebSphere, Custom). Could someone please tell me which one of these I should use for best practices? Thanks
There is no answer to your question, but on practice you have deal with 2 problem:
1. When you are going to store your peferences?
2. How you are going to maintain preferences?
And the answers are:
1. Environment variables are living in JNDI but as you know there are 3 level of topology in WebSphere: Cell, Node, Server. Cell variables can use all member in Cell, Node varables can use only mebers of Node and Sever varibles can use only server. But if you change values you need to restart WebSphere (in production).
2. Database is good place to store preferences. Most peoples knew how to update values in database (I mean analitic, administrators etc). Database configuration easy to maintain.
Both cases have perfomace impact (JNDI, Database)
Good design will bee if you put your preference to distributed cache after first reading, but you need to create your chache purge policy.
Integration Developer (000-607).
WAS Admin (000-377).