Object serialized many times - code in finalizer runs multiple times

          Using on Solaris:
          Weblogic Version 5.1 sp 8
          JDK version: java full version "1.3.0-RC"
          Clustering with:
          weblogic.httpd.session.persistentStoreType=replicated
          I have an object that stores information in a linkedList member.
          The first time a user passes through a servlet, one of these
          objects is created for them. It is stored in session.
          The object implements serializeable. Upon finalization, this
          object is supposed to flush its data once and only once to a log file.
          The object's constructor runs once. It is set and retrieved once from HttpSession.
          As WebLogic shuts down, the object is then serialized and deserialized many times.
          The finalizer of this object then runs many times as weblogic shuts down (17 or
          so times), duplicating the logging of the information
          each time. Each time, doing a this.toString() in the finalizer prints out a different
          object reference.
          I tried setting and incrementing both a static and
          instance level variable and printing them out during finalization. The static
          class variable gets incremented as you would expect, the non-static instance variable
          is always incremented from 0 to 1 each time a finalizer runs. So there is no linkage
          between the instances at the non-static level.
          We are using clustering (though only one app server was running during the test),
          JSPs, servlets, etc.
          We need to have the finalizer for each original instance of the object execute
          its logging functionality once and only once regardless of serialization/deserialization.
          Any ideas as to how this can be done or another place to put the logging code
          so it will be executed after a user session ends?
          Thanks!
          Peter
          

Using finalization is a very bad idea, both from the performance and program
          correctness points of view.
          I think you can look into using javax.servlet.http.SessionBindingListener
          (valueUnbound(event) will be called when object is unbound from the
          HttpSession) instead.
          Peter Gluck <[email protected]> wrote:
          > ---------------------------
          > Using on Solaris:
          > Weblogic Version 5.1 sp 8
          > JDK version: java full version "1.3.0-RC"
          > Clustering with:
          > weblogic.httpd.session.persistentStoreType=replicated
          > -------------------------
          > I have an object that stores information in a linkedList member.
          > The first time a user passes through a servlet, one of these
          > objects is created for them. It is stored in session.
          > The object implements serializeable. Upon finalization, this
          > object is supposed to flush its data once and only once to a log file.
          > The object's constructor runs once. It is set and retrieved once from HttpSession.
          > As WebLogic shuts down, the object is then serialized and deserialized many times.
          > The finalizer of this object then runs many times as weblogic shuts down (17 or
          > so times), duplicating the logging of the information
          > each time. Each time, doing a this.toString() in the finalizer prints out a different
          > object reference.
          > I tried setting and incrementing both a static and
          > instance level variable and printing them out during finalization. The static
          > class variable gets incremented as you would expect, the non-static instance variable
          > is always incremented from 0 to 1 each time a finalizer runs. So there is no linkage
          > between the instances at the non-static level.
          > We are using clustering (though only one app server was running during the test),
          > JSPs, servlets, etc.
          > We need to have the finalizer for each original instance of the object execute
          > its logging functionality once and only once regardless of serialization/deserialization.
          > Any ideas as to how this can be done or another place to put the logging code
          > so it will be executed after a user session ends?
          > Thanks!
          > Peter
          Dimitri
          

Similar Messages

  • How Many Times Can I Use The Same Serial Number For Adobe Creative Suite 4?

    I have design standard and was told I can use the same serial number on multiple computers. How many time can I use it? And say I install it on the maximum number of computers, but get a new computer, can I uninstall it on one of the old computers and use it on the new one? And can I use the programs on both computers simultaneously or do I have to use them one at a time?

    Fred Tech wrote:
    Broadly speaking, it depends on the type of license you have.
    Specifically, if you have a single license then officially, you should only install it once on one computer.
    Practically, (unless it has changed with CS4) you maybe able to install it on more then one computer, BUT can only run one instance of the software at a time. You can not run more then one instance of the software concurrently; i.e. you can't run Dreamweaver on Computer 1 and Photoshop on Computer 2. That would be two instances, and is not permitted.
    This is my understanding. I am happy to be corrected if I am wrong
    Fred
    Sorry Fred you are wrong.
    If you have a single license you can install it on as many computers as you like. you can only activate the suite on two computers at anyone time. Work and Home or as many of us do it Desktop and Laptop. You can not use the computers simultaneously. You only have 20 activation/deactivations so use them wisely. Student versions only have one activation. You can not break up the suite installs the suite is considered one application.

  • PowerShell using start job to run multiple code blocks at the same time

    I will be working with many 1000’s of names in a list preforming multiple function on each name for test labs.
    I notice when it is running the functions on each name I am using almost no CPU or memory.  That led me to research can I run multiple threads at once in a PowerShell program. That lead me to articles suggesting start-job would do just want I am looking
    for. 
    As a test I put this together.  It is a simple action as an exercise to see if this is indeed the best approach.  However it appears to me as if it is still only running the actions on one name at a time.
    Is there a way to run multiple blocks of code at once?
    Thanks
    Start-Job {
    $csv1 = (Import-Csv "C:\Copy AD to test Lab\data\Usergroups1.csv").username
    foreach ($name1 in $csv1) { Write-Output "Job1 $name1"}
    Start-Job {
    $csv2 = (Import-Csv "C:\Copy AD to test Lab\data\Usergroups2.csv").username
    foreach ($name2 in $csv2) { Write-Output " Job2 $name2"}
    Get-Job | Receive-Job
    Lishron

    You say your testing shows that you are using very little cpu or memory in processing each name, which suggests that processing a single name is a relatively trivial task.  
    You need to understand that using a background job is going to spin up another instance of powershell, and if you're going to do that per name what used to require a relatively insignificant amount of memory is going to take around 60 MB.  
    Background jobs are not really well suited for multi-threading short-running, trivial tasks.  The overhead of setting up and tearing down the job session can be more than the task itself.
    Background jobs are good for long-running tasks.  For multi-threading short, trivial tasks runspaces or a workflow would probably be a better choice.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • How many times can the photoshop code be used?  Like can I download it on one computer then later download it on a different computer?

    Basically the title explains my question.  How many times can the photos hop code be used?  Like can I download it on one computer then later download it on a different computer?

    You're allowed two installations/registrations. Anything above that requires deregistration on one of those computers.
    Take note that if this is Photoshop CC, it's as easy as signing out on a system; there aren't any serial numbers involved as it's all tied to your Adobe ID.

  • I have just upgraded to PSE 12 and Premier E 12, and tried to installed many times.  The pop up says "Configuration Error"; contact Adobe Tech Support(?); and "mention error code 1"!  Help please!

    I have just upgraded to PSE 12 and Premier E 12, and tried to installed many times.  The pop up says "Configuration Error"; contact Adobe Tech Support(?); and "mention error code 1"!  Help please!
    Install appeared to run okay up to,, and including "shared Technologies"....

    Troubleshoot installation | Photoshop Elements, Premiere Elements | Windows

  • Observer.update() runs to many times

    I got two classes en Observable with an Observer
    in observable:
    public void function(String message) {
    setChanged();
    notifyObservers(message);
    in observer:
    public void update(Observable obs, Object obj) {
    System.out.println(obj.toString());
    the problem is that update is runned too many times, first time function is runned, update runs one time, next time two and then three and so on.
    anyone that have had this problem and have an sollution or any tips on what that could be wrong?

    found out that i created lots of observers where i thought i only hade one, so i've already solved the problem

  • How many times can you install Lightroom 5? My problem is that I have saved my programs on C. To I have more space, I want to save my programs now on E. Can I now uninstall Lightroom and reinstall from C to E? Can I use the same license code as the first

    Please help!!
    How many times can you install Lightroom 5? My problem is that I have saved my programs on C. To I have more space, I want to save my programs now on E. Can I now uninstall Lightroom and reinstall from C to E? Can I use the same license code as the first installation?

    Thank you for your answers, it helps me a lot.
    But sorry for my ignorance. I understand how you mean it, but I don't know how to do it. I'm scared to lose the settings/edits of the images.

  • Hi , i have a 4th gen ipod touch and it runs on 4.3.5 but it wont let me update it to 5.1.1! everytime i try to install it..it says "sorry your network timed out" and wont let me! i tried so many times and it still wont work.. what to do?

    hi , i have a 4th gen ipod touch and it runs on 4.3.5 but it wont let me update it to 5.1.1! everytime i try to install it..it says "sorry your network timed out" and wont let me! i tried so many times and it still wont work.. what to do?

    Disabling the computer's security software (firewall and antivirus) usually resolves that error.

  • Please help block my ipod touch second generation and forget the code, try putting the code so many times that now says connect to itunes, I connect but will not let me do anything that tells me this should unlock with key and I should do for Please help!

    please helpme i block my ipod touch second generation and forget the code, try putting the code so many times that now says connect to itunes, I connect but will not let me do anything that tells me this  should unlock with key and I should do for Please help!. thanks

    Place the iPOd in recovery mode and then restore. For recovery mode:
    iPhone and iPod touch: Unable to update or restore

  • How many times should I run the APPLE TEST HARDRIVE/DRIVE on my macbook?

    how many times should I run the APPLE TEST HARDRIVE/DRIVE on my macbook?

    Do you mean your hardware tester or Disk Utility?
    -Bmer
    Mac Owners Support Group - Join us @ MacOSG.com
      Mac611 Mobile Mac Support - about.Mac611.com
       iTunes:MacOSG Podcast | YouTube.MacOSG.com
                       An Apple User Group 
    Have an iPhone or iPod touch? Enter Mac611.com in Safari on it for 'mobile Mac support.'

  • I have  a iphn 3gs running on ios 6.1.3  i buy it frm my frnd ..........n it has one prblm that safari mail n maps does't wrk it crashes all time when i try to run these ......plzzz help me what shoud i do ......i have tried reset many times bt it does't

    i have  a iphn 3gs running on ios 6.1.3  i buy it frm my frnd ..........n it has one prblm that safari mail n maps does't wrk it crashes all time when i try to run these ......plzzz help me what shoud i do ......i have tried reset many times bt it does't

    use a computer and restore the phone http://support.apple.com/kb/ht1414

  • How many times can you use the serial number to download the cd

    help how many times can we use the serial number to download the cd photoshop elements 11

    Download Photoshop Elements products | 13, 12, 11, 10
    Mylenium

  • How many times can you enter the wrong pin code on an iphone before it resets?

    How many times can you enter the wrong pin code on an iphone before it resets itself?

    Hey Robin.T,
    Thanks for the question. The following article provides the answer to your question:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/HT1212
    If you enter the wrong passcode six or more times, you'll see a message that says one of the following:
    iPhone is disabled
    iPad is disabled
    iPod touch is disabled
    You can also set your passcode lock to wipe the device after 10 unsuccessful attempts (Settings > General > Passcode Lock > Erase Data)
    Thanks,
    Matt M.

  • How many times can I run PSConfig.exe -cmd upgrad .... command

    I'm getting VSS error in my eventlog -> application. I was getting 8213 and followed http://technet.microsoft.com/en-us/library/cc734219(v=ws.10).aspx and
    now I'm gettting 8230.
    Meanwhile my backups not are running. I remember running PSConfig command when I first installed windows and sharepoint 2010 on this box for system backup to work correctly.
    Now I run WMIC  QFE  LIST  FULL /Format:HTable > C:\Temp\HotfixList.html to retrieve all the installed update to check if KBs
    2460045 or 2687453 are installed unnoticed but I don't have any history of installed updates suprising eh!
    Now I want to run
    PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent
    -install -cmd installfeatures
    just incase one of them have been installed unnotice.
    How many times can I run this PSConfig command? How dangerous is this decision?

    You can run it as many times as you want, but it will take SharePoint down on that particular server (resets IIS, for example), while it executes.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How many times a program has been run?

    Is there a transaction or table or something that tracks how many times a program has been run?   The number of times the program has been run plus using the programs' attributes for last changed would help me a lot.  We need this for an archiving study to determine of the client has set up the configuration correctly since they went live and have been executing the correct programs.  Thanks and mucho rewards if someone has an answer.  FYI - I have done a forum search and could find nothing on this topic.  I have looked at the tables TADIR and no help, as well as transaction STAT.

    I know ST03N transaction can be used extensively to determine how the programs were executed or even to know who all are using a particular transaction...
    I tried to find if we can find the number of executions of a program through this transaction, I could not find myself...
    try if you can find it through this tcode.
    Phani

Maybe you are looking for

  • Need a hand to configure FMS 4.5 to output HTTP stream...

    Hi folks! I'm trying to setup Flash Media Server (Streaming server) and I'm having issues with outputting HTTP stream. The system works very well with the Flash ooutput, but for some reason the livepkgr won't work. Tried several things over the past

  • Consider Special stock in MRP run

    Hi all, Is it possible to consider the special stock (table MSLB) when I run MRP (MD01)? The type os special stock is 'O' Thank in advance, Felipe Simionatto Edited by: fsimionatto on Feb 8, 2012 8:09 PM

  • How do I create a NEW 'my card'?

    I can't find a 'my card' in my contacts. Do I just create a new card and name it "my card" or ?

  • Some Questions for IDS MC?

    1. After alert events are pruned into the fold "AlertPruneData", they will become some "txt" files. Which application can I use to read the events from these txt file? 2. For the default alarm pruning, it is stated in the document only the events in

  • Oracle 9i DB + Jdeveloper + 9iAS JE / JRun / Tomcat

    HI, i just to consider which application server suitable for our business. everybody can answer/explain me below question. 1) whatis difference between above mentioned app. server. what benefit if i choose 9ias je. 2) when i try to install sample cod