How can I keep a bean alive forever through out the live of container

I want to load some important information from DB (which takes long time to calculate) into memory at the start of the app and refresh it periodically and keep it in memory for all jsp/servlets to use.
- Environment Tomcat / JDK 1.5x
I was able to do that and keep it alive as long as the app is active, but if the app is idle for a period of time some how the bean is thrown out of memory and when user acceses the page it connects to the DB again. (I have logic that if the contents of bean is empty get it from DB and keeping the data as a hashtable). I am using scope=application in all jsp's that access this bean.
Any thoughts ?? or any other way to do this (I am almost ready to write to file after long testing...) Please help.
- Ravi

You're welcome.
I think you need to define it in web.xml , as mentioned in this thread
http://forum.java.sun.com/thread.jspa?forumID=45&threadID=479858
It's written better on this thread:
http://forum.java.sun.com/thread.jspa?forumID=45&threadID=739687

Similar Messages

  • How can I keep my albums in iPhoto arranged in the order of my preference - alphabetically? Once arranged, iPhoto periodically rearranges them.

    How can I keep Albums in iPhoto in the order in which I arrange them? iPhoto periodically rearranges them in seemingly random order.

    Have iPhoto '11. Several times I have arrangged the Albums in alphabetical order. Perhaps "periodically rearrange" isn't the correct terminology, but if not the next time I open iPhoto then the 2nd or 3rd or 4th or..., the albums are in a different order, non-alphabetical. This was not a problem in the last iPhoto version.
    Don't understand your question of "what goes on..."

  • How can I keep my emails from being deleted from the Telus server so I can view them on my home computer as well?

    How can I set my IPad email account to leave the messages on the server?  I want them left on the Telus server until I choose to delete them.

    I have POP mail accounts on my iPad.
    Settings > Mail, Contacts, Calendar leads me to the correct place.
    At the top will be a list of my Mail accounts.
    Tapping on an Account brings up all the info in the account.
    The Advanced choice is at the bottom of the window and usually requires scrolling down to see it.
    Tapping Advanced brings up another widow with the Delete from Server choice. Tap that and you can then tap Never.
    I'm using an iPad 2 and an iphone5 running iOS 6.0.1

  • How can I keep my video sound from cutting out?

    The last couple of weeks the sound on my videos has been cutting out after I play them on Itunes on my computer, usually after a few seconds to a minute or two. I do not have the same problem when I load them on my really old Ipod Touch however. How can I fix this problem? Everything else seems to play fine except the video audio on the computer when I use Itunes. I thought it was just the tv show audio that was affected, but I just tried a couple of movies and the soundtracks are having the same problems. The root menu screens were running fine, but when the actual movies started playing it started to cut out. Please help!

    Try repair your QuickTime from control panel. Programs n features.
    If that doesnot work, go to
    Control panel
    Sound (Hardware n Sound)
    Under Playback tab, highlight each device and click Properties button
    Go to Advanced tab and change Sample Rate to 16bit 48000hz (DVD Quality) or 96000hz (Studio Quality), OK n OK.

  • HT1495 HOW CAN I KEEP ALL OF MY INFORMATION SEPERATE FROM THE OTHER USERS ON MY ACCOUNT?

    We have two iphones and a ipad therefore I need to know how to make each item on a seperate account.  Everyone's information goes on everyones electronic device.  How can I fix this?

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    Also... See this Discussion...
    https://discussions.apple.com/message/17613637#17613637

  • How can I play an animation in reverse only if the symbol that contains the animation is visible? if the symbol is not visible have the trigger no longer target that symbol?

    Hi
    I have a button the does two functions at the same time. it plays a symbol's animation in reverse (in order to hide it) and it slides an element. the symbols animation is triggered by another button (which is not relevant) . So my problem is that if the animation has been triggered first than when the button is pushed the animation plays in reverse, the symbol hides and everything is fine, but if a push the button before that the animation will flash in reverse. SO how can I tell it to only play in reverse when the symbol's animation has run. I know it's an if / else statement but i have no idea how to do it.
    thx

    Here is a case close to your issue:
    if ( sym.getSymbol("Symbol1").$("Text").is(":visible") ) { sym.getSymbol("Symbol1").playReverse(); }
    else { sym.getSymbol("Symbol1").play(); }
    Demo files ==> isVisible.zip - Box

  • How can i keep one email box separate from all the others....?

    I have 4-5 personal email accounts. Mail gets them all, and it works as i want it - with ALL my inboxes and sent mail aggregated.
    However, i now want to add my business exchange account. I want this totally separate - not mixed in with personal.
    Ideally i'd like to run two instances of mail - is that possible?
    If not, i'd like a completely separate set of mailboxes (in, sent, drafts, etc) for exchange mail.
    Can thsi be done? How?
    thanks.
    Grant

    At some point i just sigh and continue to use OAW, bad as it is.
    What is the problem with the suggestion I gave you?
    IO rally want to figure out a way to trick the system into letting me run two instances, or keeping the two accounts independent.
    Even if you could trick the system into running two copies of Mail, what do you think that would accomplish? They would both try to access the same Mail settings and data files. If the workarounds posted here aren't sufficient, you will just have to use a different mail client.
    'Tis a shame there is no true outlook for MacOS.....yet.
    LOL, that's like saying it's a shame you can't walk into a restaurant and order a plate of dog poo...

  • How can I keep pictures images from  opening up in the body of an email

    Every time I attach a pic in mac mail, it opens in the body of the email.  I never had this issue with Outlook.
    I typically attach several pics at a time, the email becomes very messy.  Any suggestions on how to keep it from opening.
    I am using jpeg images.
    Plantguy1

    It depends.
    When you copy an image from a website in Firefox (right-click > Copy Image), Firefox stores the HTML code that website is using to display the image. Then when you paste into Yahoo mail, Yahoo uses that code to display the image in your message, by linking out to the source site.
    However, if you copy the image from a source other than a web page, Yahoo mail (webmail interface) can't use this technique and although it sometimes seems to show the image in the post, when I send, I just get a strange "inline image" notation in its place.
    If you access your Yahoo mail on a device in a dedicated mail client, then you usually would have more options because the mail program will encode the image into the message.

  • How can i keep music on my iPad with out my laptop wanting to delete it. my laptop does not have the music that os on my iPad and i dont want to lose it but i would like to add my laptops music to my ipad

    hi, i was jsut wondering how i can keep music on my ipad without itunes wantting to delete it i dont have the music that is on my ipad on my laptop and i would like to keep it on my ipad. but i would also like to add my laptops music to it. can you help me?
    my music on my ipad is not all from itunes.

    Open itunes, connect iphone,select what you want, sync

  • How can I keep 16:9-format when exporting to the camera

    Yesterday happened something, what never happened before:
    A movie recorded in 16:9, edited on IM HD6 in 16:9 can only be exported back to my Sony HD-Camery in 4:3. Camera is preset for 16:9. That means, the globe in my movie is becoming an oval! When I imported this "Oval"-Tape back to an new iMovie-Folder, it is again 16:9.
    Can everybody unravel that mystery?
    Thank you for help.
    iMac, iLife   Mac OS X (10.4.3)   Intel-iMac, Sony HD-Camcorder

    Besides starting with a 16:9 iMovie Project you must choose the "Expert Settings" when exporting to QuickTime.
    Choose DV Stream. Double check those settings by clicking the "Options" button. This is where you'll find the aspect ratio for your DV file.

  • HOW CAN I FIX MY CANON PIXMA 2120 WITH OUT THE CD

    Solved!
    Go to Solution.

    Hi lisaberry,
    If you are trying to reinstall the printer without the installation CD, you can download the drivers and software for the printer from the Canon USA website.  So we can provide you with instruction applicable to your computer, please reply with what operating system is on your computer (version of Windows or Mac OS X).  
    If the printer is displaying an error, or if you are having another issue with the printer, please reply with a description of the error or issue and we will be happy to see how the issue can be resolved.
    If this is a time-sensitive matter, additional support options are available at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How can I down load a new app with out the cloud sign how do I get the sign off

    II'm trying to down load a new app but every time I try all I get is the cloud sign how do I get rid of it

    Touching the cloud icon should re-download the App.
    If not what happens?

  • How can I keep music while switching iPods?

    My fiancee just replaced her old nano with a new iPod mini touch. Her music on the current iPod will be deleted when her new one gets plugged in for the first time, since she hasn't synced her pod in years. How can she keep it and have it transferred to the new one? Thanks in advance!

    The music sync is one way - computer to ipod.  The exception is itunes purchases.  File>Transfer Purchases
    Did you fail to maintain a backup copy of the music?

  • How can I keep my batery longer?

    How can I keep my battery longer?

    None of the suggestions thus far have a significant affect on battery life.
    Screen brightness on Automatic is the best setting, as it provides only as much brightness as you need.
    WiFi uses ZERO power when the phone is on Standby, and minimal power when the phone is active. But if you are within range of a WiFi hotspot WiFi will use less power than Cellular data. So unless you have the phone actively being used for hours at a time the WiFi setting will make no difference.
    3G off will save some power in light use because GPRS uses less power but is MUCH slower. So if you are transferring a lot of data turning 3G off will actually use more power, since transfers will take 3-4 times as long and the difference in power consumption between 3G and GPRS is only 2 times.
    Bluetooth uses no significant power unless you are actively using a Bluetooth device, and then you would clearly want it on. BT runs at 3 milliwatts, hardly enough to matter.
    If you did all of the suggested things you might get an extra few minutes a day.
    If your phone is using a lot of power there are only 2 possible causes - Interactive games, and large data transfers. Nothing else on the phone comes close these two uses. FIRST you should determine if your power use is within spec for your paticular usage pattern. It probably is, but you can work it out for yourself by comparing your usage to the specs for the phone: http://www.apple.com/iphone/specs.html

  • TS2755 Now that my husband has an iPhone5 as well, he receives all the messages sent to me, and my replies to them. How can I keep my messages private?

    Now that my husband has an iPhone5, he receives all the messages sent to me, and I receive his. Do I have a setting wrong? How can we keep our messages private?

    Go into the settings app.
    Settings > Messages > Send and Receive from
    Set each phone to send and receive only from the specific phone number assigned to the phone and the specifics one number of each user.
    If you each are using the same App,e ID I suggest one of you getting a different ID to keep all your stuff separate. I also recommend that each of you have different email addresses.

Maybe you are looking for

  • Keeps asking me to update when I open adobe muse

    I have loaded the latest update of Adobe Muse and every time that I open the program it asks me to update  and directs me to CC to do the update which has already been done.

  • Can someone explain what a smart album is?

    I went to the iPhoto help section but need a basic explanation of what a smart album is and why I should make one. Thanks!

  • Does EM GC support portal?

    We have a legacy monitoring product that is deployed on WLS as well. If we can embed it into EM console frame as a portalet, our Manager server will be reserved so that we can save our development effort. My question is that does EM GC support portal

  • Mega probs after last Apple update... is it just me? No idea what to do...

    I just uploaded the new updates as have been without internet for >6weeks: from memory a security one, new itunes and quicktime... G4 worked fine that night. Today - wouldn't start up. Reset it 3 times as stuck on screen after log in. Left it and aft

  • Texting Multiple People

    So I went out and bought that "iPhone--The Missing Manual" and read it last night. On the book, don't spend the money, just go get a coffee and hang out at Barnes and Knoble and flip through it...you will find the few workarounds that make it worth t