Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best Practice to define Variables in Websphere

 
Stephen Tret
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stephen Tret
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anton
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic