This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Websphere and the fly likes Best Practice to define Variables in Websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Best Practice to define Variables in Websphere" Watch "Best Practice to define Variables in Websphere" New topic

Best Practice to define Variables in Websphere

Stephen Tret

Joined: Feb 03, 2011
Posts: 17
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
Anton Novopashin

Joined: Feb 25, 2008
Posts: 19
Hi, Stephen
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.

Best regards,
Anton Novopashin

OCJP (1Z0-851).
Integration Developer (000-607).
WAS Admin (000-377).
Stephen Tret

Joined: Feb 03, 2011
Posts: 17
Thanks Anton
I agree. Here's the link:
subject: Best Practice to define Variables in Websphere
jQuery in Action, 3rd edition