Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best Practice to define Variables in Websphere

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Anton
 
Men call me Jim. Women look past me to this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic