Re: Global Data
Chris Pratt <[email protected]> Wed, 31 Aug 2005 21:42:31 -0700
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_7626_26204659.1125549751362 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Use the static singleton pattern to construct a States object to hold the= =20 static data. Make sure it has some method to allow it to be reloaded on the= =20 fly. Then add an extra web page to your web app (possibly with higher=20 security) that allows you to reload the States singleton after you've=20 updated the database. Or even better have that page present you with a form= =20 to add the new State to both the singleton and the database in one=20 fell-swoop. (*Chris*) On 8/31/05, SUBSCRIBE EJB-INTEREST anonymous <[email protected]> wrote: >=20 > Hi, > I have a question. > In my web application, when the user logs in, I have to load all State > information from the database and display it.The State information will b= e > common to all users.I would add new States into the database table. > My question is what is the best way to get the state information from > database and store it globally,so that, it can be shared by all users. >=20 > If I use servlet for this, and load the state information in the init(), = I > have to restart the server whenever I add new state information to the > database, inorder to get the new states.I don't want the server to get > restarted whenever I add state information to database.SO, this option is > not feasible. > Is there any other way to do this? >=20 > Any ideas/suggestions to resolve this issue would be very helpful for me. >=20 > Thanks in advance. >=20 >=20 > _________________________________________________________________________= __ > To unsubscribe, send email to [email protected] and include in the=20 > body > of the message "signoff SERVLET-INTEREST". >=20 > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ------=_Part_7626_26204659.1125549751362 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Use the static singleton pattern to construct a States object to hold the static data. Make sure it has some method to allow it to be reloaded on the fly. Then add an extra web page to your web app (possibly with higher security) that allows you to reload the States singleton after you've updated the database. Or even better have that page present you with a form to add the new State to both the singleton and the database in one fell-swoop.<br> (*Chris*)<br><br><div><span class=3D"gmail_quote">On 8/31/05, <b cla= ss=3D"gmail_sendername">SUBSCRIBE EJB-INTEREST anonymous</b> <<a href=3D= "mailto:[email protected]">[email protected]</a>> wrote:</span><blockquote= class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); = margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi,<br>I have a question.<br>In my web application, when the user logs in, = I have to load all State<br>information from the database and display it.Th= e State information will be<br>common to all users.I would add new States i= nto the database table. <br>My question is what is the best way to get the state information from<b= r>database and store it globally,so that, it can be shared by all users.<br= ><br>If I use servlet for this, and load the state information in the init(= ), I <br>have to restart the server whenever I add new state information to the<= br>database, inorder to get the new states.I don't want the server to get<b= r>restarted whenever I add state information to database.SO, this option is <br>not feasible.<br>Is there any other way to do this?<br><br>Any ideas/su= ggestions to resolve this issue would be very helpful for me.<br><br>Thanks= in advance.<br><br>_______________________________________________________= ____________________ <br>To unsubscribe, send email to <a href=3D"mailto:[email protected]">= [email protected]</a> and include in the body<br>of the message "s= ignoff SERVLET-INTEREST".<br><br>Archives: <a href=3D"http://archives.= java.sun.com/archives/servlet-interest.html"> http://archives.java.sun.com/archives/servlet-interest.html</a><br>Resource= s: <a href=3D"http://java.sun.com/products/servlet/external-resources.html"= >http://java.sun.com/products/servlet/external-resources.html</a><br>LISTSE= RV Help:=20 <a href=3D"http://www.lsoft.com/manuals/user/user.html">http://www.lsoft.co= m/manuals/user/user.html</a><br></blockquote></div><br> ___________________________________________________________________________ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". <p> Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html <p> ------=_Part_7626_26204659.1125549751362--