Keeping track of an int value when server is stooped

Hi
In my JSP custom tag I have an int value which is used to keep track of the number of people that have visited the site. If the server was to be stopped or if it crashes is there any way where the int value can be stored and retrieved when the server starts up again? I am using tomcat but am reluctant to write to a text file whenever the int value is incremented for efficiency purposes. IF the server is stopped would there be any possible ways to store the number (it would be ok to write to text file just before stopping of tomcat happens).
Thx
Bal

yes....
you can do using context listeners....
in the start of context listeners read from the file and add to context ... and when the context becomes inactive write to a file....
for that you should use tomcat4.01 ... cause only tat has servlet 2.3 implementaion.
if you are not using tat .. write to the file every 10 minutes .. atleast you will have the latest update of the counts when something crashes......................

Similar Messages

  • Need to Keep track of last prompted value

    I have a requirement. I need to keep track the last prompted value.
    Like, If we have run a report for '01-01-2013' date and 'Sony' Category. If the same report I will run in next time the report should run with those default value ('01-01-2013' date and 'Sony' Category). That means default value of a dashboard prompt should be the last prompted value.
    Please tell me how to achieve the same.

    Teach your users how to properly use "Saved Customizations": http://docs.oracle.com/cd/E23943_01/bi.1111/e10544/dashboards.htm#BIEUG395

  • Why do my songs and audio books keep getting erased when I add a new book?  Now some books will not play and the iPod does not keep track of where I was when I pause a book, leave for music and then go back!

    About a month ago I added some new audio books to my iPod Classic and then after disconnecting, I discovered EVERYTHING had been erased. 
    I had to restore through my iTunes but then I could not load my music back on.
    I uninstalled / reinstalled iTunes and completely reformated the iPod drive.
    I successfully got my music and books back on but then added a new book two days ago only to discover everything got erased AGAIN!!!
    Of course, my 1 Year Warranty was up about a week before the first incident.....
    I formatted the iPod again, uninstalled / reinstalled iTunes (it was freezing during sync) and downloaded all my music and books again.
    Now I have several books that will not play (they play on iTunes and they played on the iPod before all these events) and the iPod does not keep track of where I was in a book when I have to stop and go to something else.
    Does anyone know what is going on with this thing???  I have a 5th Gen Video and in all the years I've had it, I've NEVER had problems like this! 
    Does anyone have any ideas on what I can do to get my iPod Classic up and running properly again?
    Thanks.

    When iTunes/iPod sync process failed due to timeout, the iPod, has only the initilaised  filesytem structure at the start of the Sync.
    The timeout failure could be due to
    Bad hardisk - do the iPod disk diagnostic, refer to this excellent post by tt2
    Slow USB port or resource - Dont use any USB hub, disconnect all other USB devices while syncing
    Timeout due to Antivirus or other plugins - disconnect from Internet and stop the Antivirus or monitoribng software if you are syncing.
    Preferably stop doing other things while syncing this ancient device, which the latest iTunes designer, think will soon be extinct.
    Have a nice day!

  • How to keep track of how many records to display in a page.

    Hi All:
    I am using Weblogic 9.2, Web Services Client, and Struts.
    I have a java client in struts that calls a web services.
    The "ID" field contains a Java integer.
    The "First_Name" is a Java String.
    The "Effective_Date" field is a Java date field.
    The web service returns an arrayList of a class called Result.
    Code for Result.java:
    >
    public class Result
    int id;
    String first_Name;
    Date effective_Date;
    public int getId
    return id;
    public void setId(int id)
    this.id=id;
    public String getFirst_Name()
    return first_Name;
    public void setFirst_Name(String first_Name)
    this.first_Name = first_Name;
    public Date getEffective_Date()
         return effective_Date;
    public void setEffective_Date(Date effective_Date)
         this.effective_Date=effective_Date;
    From the arrayList, I displayed the result as the following:
    ID FIRST_NAME EFFECTIVE_DATE
    3 John 9/10/2007
    2 Andrew 1/11/2006
    5 Peter 3/4/2006
    The "ID" header is a link.
    The "First Name" header is a link.
    The "EFFECTIVE_Date" is a link.
    If I clicked on the link "ID", the first time, it will sort the rows in ascending
    order like the following:
    ID FIRST_NAME EFFECTIVE_DATE
    2 Andrew 1/11/2006
    3 John 9/10/2007
    5 Peter 3/4/2006
    If I clicked on the link "ID", the second time, it will sort the rows in descending
    order like the following:
    ID FIRST_NAME EFFECTIVE_DATE
    5 Peter 3/4/2006
    3 John 9/10/2007
    2 Andrew 1/11/2006
    If I clicked on the "First_Name" field the first time, it will sort the rows in
    desceding order.
    If I clicked on the "First_Name" field the second time, it will sort the rows in
    ascending order.
    This applies the same for the "EFFECTIVE_DATE".
    If the arrayList returns 80 records of class Results.java.
    I needed to displayed only the first 50 records for the first page and 30 records for the second page.
    How do I keep track of that so that when I am in the second page, I know to display only record 51 to 80?
    If I have a arrayList that returns 120 records of class Results.java.
    In the first page, it displayed only 50 records.
    In the second page, it displayed only 50 records.
    In the third page, it displayed only 20 records.
    Assuming I am able to sort the rows by ID, FirstName and Effective_Date by using Results.java implementing the
    Java Comparator class. Is it still possible to keep track of how many records displayed in the first page and how many records should
    be dispalyed in the second page?
    Any hint would be greatly appreciate.
    Yours,
    Frustrated.

    Hi,
    Access the table through SM30. It comes blank as standard. Click "New Entries" and make entries for changes to be tracked. For example, whenever an org. unit changes 002 and 003 relationship, you will make entries like:
    01 O 1001 B002 Activate box checked
    01 O 1001 B003 Activate box checked
    Here, 01 is your active plan version, O is org. unit, 1001 is infotype and B002 and B003 are the subtypes. You can also use * for infotype and subtype which means every change will be logged.
    If you then run the report RHCDOC_DISPLAY through SA38, it will pick up all the changes pertaining to B002 and B003 relationship for org. units (in the above example).
    Similarly, you can set up this table for other object types.
    For more information, follow SPRO>Personnel Management>OM>Basic Settings>Activate change documents and go through the documentation for that node. Also, read up the documentation for the report.
    Hope this helps.
    Donnie

  • How keep track of caller from web page or app in your EJB

    I want to make a Security Handler for my EJB Server. I want apps / users to be able to log in. However, after they log in (for example from a web page), how do I keep track of who they are when they then make subsequent calls to EJBs?
    Where can I find out who they are?
    How do I standardize this for apps and web page callers?
    I know that for web servers to keep track of who the caller is for them, they need to store a handle on the client. Do I need to do this too?
    If I do keep smth on the client side that they send back/forth to me, does that not fit with the EJB standards?

    still unable to find answer. Hey, can I also ask: do I ask too obscure questions? I don't get most of them answered. Are they boring?

  • How do 3rd party companies keep track of who to bill?

    I went to go buy a ringtone from a website and the website told me my account activity had maxed out.  I changed my phone number and the website still said that.  How do those websites keep track of who to bill when you can change your phone number?

    When you make a purchase from a third party think of your cell phone number as the credit card and your device as your home address. They have to know how you are paying and where it is going. Just because you change how you pay ( your phone number) you are still having it sent to the same place. When you register for a 3rd party service it links to the ESN number for your device. Hope that helps a little

  • How to keep track of client in rmi server

    how can I keep track of a disconnected client in a rmi server ?
    And what logic do I use to disconnect a client fro mthe server ?

    When a RMI client receives a stub to the remote object, RMI client runtime sends a dirty() call to the RMI server runtime which in turn helps the RMI server runtime in updating the client references to the remote object. Client reference is nothing but a unique identification generated by client RMI runtime for that instance of JVM. RMI uses a reference counting algorithm for destroying unreferenced remote objects. Once all references (all clients who are holding the stub to this remote object) to a remote object drops to zero, local garbage collector takes care of freeing this remote object.
    RMI client runtime initiates a TCP connection with the remote object only when a method is invoked on the stub. RMI transport layer uses a simple connection pooling mechanism to use already established TCP connections with server objects in further remote method invocations. Let's say the client is invoking a remote method on the remote object's stub fetched from the registry service. Now RMI transport layer initiates a TCP connection with the remote object (exported at ("host1", 4567)). After completion of the remote method, RMI client's transport layer keeps the connection open for some time (some configurable value) to take the advantage of the already established TCP connection in future remote method invocations on remote objects exported on the same host and port ("Host1", 4567"). RMI transport layer also takes care of closing these connections if the connections are idle more than configured value of connection open time.
    From the RMI server's perspective, once the RMI server runtime receives a remote method invocation request from the RMI client, it creates a new thread and try to dispatch the method on the designated remote object. After returning the results of the remote method to the client, RMI client's transport layer may not end this conservation with this remote object to take the advantage of this TCP connection in future remote method invocations. So the same thread may be used for dispatching another remote method in future. This is actually the side effect of re-using the established TCP connections on the client side.
    RMI server maintains client's reference in the client's reference set of the remote object as long as the client holds a normal reference to remote object's stub in its JVM. Once the client relinquishes the reference to the stub (goes out of the scope or setting it to the null), RMI client automatically sends clean() call to the RMI server runtime to update client reference set of the remote object. There is no public API to lookup or manipulate the client references for a given remote object, but you can always unexport the remote object even some clients are holding stubs to the remote object. Next time when the client invokes the remote method using this stub, client will receive a "connection refused exception" from the server because the remote object is already unexported. Let's say if the RMI server is started again (remote object is exported and registered with registry service), the client once again obtains the stub to the remote object from the registry service instead of using earlier stale stub. (This time remote object may have been exported on different port, so the port details in the old stub may not be valid any more).
    At any point of time there can be more than one established TCP connection with the RMI client. This may be the temporary condition; RMI client's transport layer automatically closes these connections if it does not receive any remote method invocation requests with in a pre-determined interval of time (default: 2 min). You can always find out RMI client's host in a given remote invocation by using getClientHost(), but how can you semantically define a "disconnected client in a rmi server" in your application context ? You can always force all the clients to fetch the stub again in future remote method invocations by unexporting the remote object in RMI server. I hope this information helps ...
    -- Srinath Mandalapu

  • How do I keep track of when a signal hits a certain voltage?

    I am fairly new to Labview, and I am having trouble with the following.  I am working on replacing a Digital Vector Filter with Labview software.  I have a rotating shaft with eccentricities, which are measured by X and Y proximitors.  Also, a keyphasor voltage keeps track of the rotation rate, which enables me to relate X and Y to each other. Essentially, I have to find when the keyphasor voltage hits -11 volts, and keep track of when that happens, then, keep track of the next time that happens, in order to get the time it takes for one revolution. I don't know if this makes a difference, but the data is coming in as dynamic data.  I want to be able to tell the user what the rotational rate is as the program is running.

    Thanks for the help!
    I have taken the vi you gave me and changed it to a bit.  The voltage going in is being sampled rather quickly, and thus there is no actual point that equals -11 Volts. I want to do something like the following: Check timer time, tm, and check:
    if tm-1 > -11 Volts   and tm < -11  
    do the following calculation to get the actual value time that voltage crosses -11 Volts, tk.
    tk= (tm-1) + (  (tm- (tm-1)     ) / ( Km - (Km-1)  ) )  *  (-11-(Km-1)),      where Km is the voltage at tm.
    I want to be able to do this streaming, to show the user what the tk value is live.  The only times I really need to save are tm and tm-1, from there I can save all the tk's in an array for further analysis.
    Please let me know if this is possible.
    Thanks 
    Attachments:
    keyphasordata.xls ‏1773 KB
    Barebones.vi ‏90 KB

  • Keeping track of current clients on server

    My problem is that i have all these clients connected to my server. I don't want the same client connecting to the server if he is already connected.
    I was thinking that I could keep track of who is currently connected on the server side, but that leaves many gaps. What happens when a client crashes, and he just drops off the server. The server won't know this happened, and it would be hard to know which client dropped off.
    My next idea was that the server could send a query out to the clients, and each client that threw a IOException would be a client that wasn't logged on anymore. and i could cut his server connections, and end his thread.
    Is there maybe a better way to keep track of clients currently connected to the server?

    The idea of probing the clients can be a bad one, because it takes some time for the server to figure out that a client isn't on. The query you send out will be the same as any other data, and if the query could find out the connection is down, then the connection would already have been broken somewhere else, and you'd know the user is offline. (Assuming you have sane coding practises, which is an IOException handler around the main data loop, and a finally{} block which marks the user as disconnected.)
    One way to ensure that the same user isn't connected twice is to boot off the first instance when the second instance connects. Regrettably a lot of company's solutions to this problem are the other way around, and block you from logging into the server until the first connection times out (a good example of this is the MMOCRPG, Ragnarok Online, where getting disconnected means having to wait about 60 seconds until the server realises your first connection is gone. ;-))

  • HT4864 problems with iCloud mail server on the mail, but it does not fix it when I put the password in, keeps asking me for password. When I go into iCloud to access it from safari, it accesses the icloud fine with my password. I have reset all the settin

    I am running os x 10.7.5, on a macbk, I have been using all the apps fine and not changed anything or run any software updates, suddenly my mail dows not think it can connect with the outgoing server for icloud and requests my password, which I give, but it repeatedly asks again and again. I have tried re-setting all the mail for icloud up again, and it thinks its ok, except the box keeps flagging up can't access outgoing server. I have checked it all a number of times, and I can access the icloud stuff including mail from http when I log in there. Anyone know why my mac will not accept my icloud password? suddenly I cannot get any icloud mail in or out, but I changed nothing. Why does it do this and why can't i fix it?

    No carrier "automatically" unlocks at end of contract - many won't do it at all, even if requested.  I don't know what your carrier's policy is since you didn't say what country you're in.
    However, if I understand you correctly, you didn't change carriers so it doesn't matter if it was unlocked or not. Try the following steps, as needed:
    1. Reset phone - press both home and sleep/wake buttons for at least 19 seconds until the Apple logo appears
    2. Settings > General > Reset > Reset Network Settings
    3. Restore phone in iTunes using a backup
    4. Replace SIM card (don't care what Telstra says)
    5. Restore phone in iTunes as new, without using a backup
    6. Take phone to Apple.

  • I keep getting a message "The MobileMe IMAP server ... rejected the password for ...."  I can use that password when I go to iCloud, but my e-mails won't download to my computer.  What's the mix-up?

    I keep getting a message "The MobileMe IMAP server ... rejected the password for ...."  I can use that password when I go to iCloud (and to this discussion), but my e-mails won't download to my computer.  What's the mix-up?

    If the setting is greyed out perhaps you have restrictions enabled that would prevent someone from changing accounts. Settings>General>Restrictions>Allow Changes>Accounts.

  • I keep getting an error pop-up when I try to access my email. The pop-up says Cannot Get Mail  The connection to the server failed.  I get this pop-up on both my iPhone 5 and my iPad. I can still access my email, but the pop-up is real annoying.

    I keep getting an error pop-up when I try to access my email. The pop-up says Cannot Get Mail  The connection to the server failed.  I get this pop-up on both my iPhone 5 and my iPad. I can still access my email, but the pop-up is real annoying. Can someone please help me with this?  -Stu

    Hi StuNYC,
    Welcome to Apple Support Communities.
    It sounds like you're seeing an alert message when opening Mail on your iOS devices. Do you have multiple email accounts setup on the devices? Take a look at the article below, it provides suggestions that will resolve most issues that  cause an alert like that to appear in when starting the Mail app.
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    I hope this helps.
    -Jason

  • I keep getting a " the connection to the server failed" when trying to use hotmail

    I keep getting a "The connectioin to the server failed" when trying to use hotmail

    Go into Settings, Mail, Contacts, Calendars, select the Hotmail account and check the account settings. Did you set it up with the Hotmail preset? Has this account ever worked on the iPhone? What other troubleshooting have you done?

  • TS2621 I keep getting the error message "yahoo! server unavaible" when trying to set up my email

    I just got my Iphone 5 and I'm trying to set up my email.  I keep getting the error message "Yahoo! server unavailable".  Help!  Thank you.

    There are different ways, but delete that email account and this time when you go to set up your email, dont start in the yahoo setup tab, do it in the " Other " tab and set it up that way.

  • Can I keep the CC value when user click the REPLY TO button in outlook?

    Hi all,
    I have set the CC value when I send email out. But when user reply the received email, the CC value will be displayed in the TO field. If anyone knows how can I keep the CC value unchanged when user reply the received email?
    Thanks very much.

    It depends entirely on the mailer they're using, you have no control over it.

Maybe you are looking for