Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set application scope for variables in weblogic

Status
Not open for further replies.

venkataramani

Programmer
Apr 17, 2002
2
US
I am new to weblogic and migrating form IIS. We have a product where in some reference details like list of states or countries in the application scope. It was possible for me to define in the global.asa file.

Is there any file which will be executed once when the server is started where in I can define my variables with app scope or any way to define the scope of the variables. All I need to do is have the list of variables in application scope right from the moment the web server is started.

Can anyone help me in this regard
Thanks
Venkat
 
This is usually done in the Web Application Deployment Descriptor (web.xml). You could also bind these values to the JNDI tree but most likely this is not going to gain you very much except for greater maintenance.
 
The current site has many pages where in it calls class methods to load the list of states which involves calling the database. Currently we have atleast 4 screen showing the drop down list of states which might increase according to the products purchased as each prouduct might have different shipping address.

Might be I can make use of session stateless bean for keeping the list of states in the memory till the service is brought down. I thought instead of going for a Session Bean, we can go for a class which can be made up as a start up class with application scope. Really speaking I am left with no clue to do this. I don't know what to do next. Since this is not giving trouble now we are quiet happy but for sure it will give us a problem when the number of users hitting the site turns up more. (We are in dev phase.)

Any suggestions to acheive my goal for to less overhead resource cost and to load the pages at real quick time.

Thanks
Venkat
 
A good solution for information that changes rarely (from outside sources) is to use Read-only Entity Beans in WebLogic. I use them for alot of information of this type and it works out very well.

Just a plain Java class implementing the singleton pattern will suffice for static information that pretty much never changes. When was the last time a state was added? 1959?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top