JMS session is not closed even after calling close()

Hi All,
I am using JMS to receive and publish topics for a process,in my java code i
am creating new JMS Session on demand(ie., whenever a new topic is
received) after processing the topic i am closing the session with close(),but
still the session is not closed.In a period of time more sessions are created
and FD leaks occurs which stops the process functionality.
Later i moved the on demand session code to a static block, its working fine
and no FD leak occurs.
Is this a known behavior or any java bug is there to point this issue,please
help me regarding this.
Thanks,
Ants Balajei

You should try avoid creating sessions on demand but cache/pool them...
http://activemq.apache.org/how-do-i-use-jms-efficiently.html
James
http://www.iona.com/
Open Source the Enterprise Way

Similar Messages

  • Session does not end even when i close browser

    when i close firefox/IE the session continues ,What i need is that i am adding amount in shopping cart ,but the amount adds to old amount even when i open a new browser window ,
    i hv checked that my browser will remove cookies when i will close mozilla
    i hv also printed total=0 in servlet's ini method but the init method is called only once and total does not reset to 0,does 'th the call to init method is made everytime we start a new session via browser ,it does not get called whn i close the current browser and open new one.how to destroy the older servlet?
    I m using s=request.getSession()
    and s.setAttribute("billamnt",total)
    the code of the servlet is
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class addtocart extends HttpServlet
         HttpSession s;
         PrintWriter pw;
         int total,cam,mob;
         public void init()
              total=0;
              cam=0;
              mob=0;
              System.out.println("inside  cart init");
    public void service(HttpServletRequest req,HttpServletResponse res) throws IOException
         s=req.getSession();
        res.setContentType("text/html");
         pw=res.getWriter();
         pw.println("<html><body><a href="+"mobs"+">Mobile</a><br><a href="+"cams"+">Camera</a><form method = "+"post "+"action ="+"bill"+"><br><input type= "+"submit"+"></form></body></html>");
        if(req.getParameter("csony")!=null)
        cam=cam+Integer.parseInt(req.getParameter("csony"));
        if(req.getParameter("clg")!=null)
        cam=cam+Integer.parseInt(req.getParameter("clg"));
        if(req.getParameter("cnokia")!=null)
        mob=mob+Integer.parseInt(req.getParameter("cnokia"));
        if(req.getParameter("cerricson")!=null)
        mob=mob+Integer.parseInt(req.getParameter("cerricson"));
        s.setAttribute("cambill",new Integer(cam));
        s.setAttribute("mobbill",new Integer(mob));
        s.setAttribute("billamnt",new Integer(cam+mob));
    public void doPost(HttpServletRequest req,HttpServletResponse res)
    public void doGet(HttpServletRequest req,HttpServletResponse res)
    }Wats the problem?
    Message was edited by:
    pooja_k_online

    The servlet is not created on a session basis. All users share the same servlet object. The servlet is created once when the servlet is first called in the context, then is maintaned until the server shuts down.
    You should not store any state in the servlet. You should use the HttpSession object you get from the request object to store the totals, and all other values. You should not use the servlet to hold on to a session object, as multiple users would see the SAME session that way. If you need to use the session in multiple methods, then you should pass that object as parameter, not by making it a class member.
    You also shouldn't put the work in the service method of the HttpServlet. You should put it in either the doGet or doPost method (and if you want to make it happen for both type requests, call doPost from the doGet method and put the work in the doPost method).
    For example:
    public class ShoppingCartServlet extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
      public void doPost(HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        Integer cambill = (Integer)session.getAttribute("cambill");
        int cam = 0;
        if(cambill != null) cam = cambill.intValue();
        Integer mobbill = (Integer)session.getAttribute("mobbill");
        int mob = 0;
        if(mobbill != null) mob = mobbill.intValue();
        Integer billamnt = (Integer)session.getAttribute("billamnt");
        int total = 0;
        if(billamnt != null) total = billamnt.intValue();
        String csony = request.getParameter("csony");
        if (csony != null) cam += Integer.parseInt(csony);
        String clg = request.getParameter("clg");
        if (clg != null) cam+= Integer.parseInt(clg);
        String cnokia = request.getParameter("cnokia");
        if (cnokia != null) mob += Integer.parseInt(cnokia);
        String cerricson = request.getAttribute("cerricson");
        if (cerricson != null) mob += Integer.parseInt(cerricson);
        total = cam + mob;
        session.setAttribute("cambill",new Integer(cam));
        session.setAttribute("mobbill",new Integer(mob));
        session.setAttribute("billamnt",new Integer(total));
        PrintWriter pw=response.getWriter();
        pw.println("<html><body><a href="+"mobs"+">Mobile</a><br><a href="+"cams"+">Camera</a><form method = "+"post "+"action ="+"bill"+"><br><input type= "+"submit"+"></form></body></html>");
        pw.close();
    }Message was edited by:
    stevejluke

  • AS Java sessions are not closed until they time out

    Hello Experts,
    we have a SAP PI system to integrate SAP R/3 with external applications and recently we are facing a problem with inactive sessions. There's a new application we are setting up that consumes a webservice published by this SAP PI system. The scenario is SOAP --> PI --> PROXY. What we have noticed is that when the application sends loads of requests sometimes the system fails. This is because we are reaching the maximum number of open sessions in AS Java (1000). Investigating a bit more we found out that the sessions are not "closed" once the communication between the application and SAP PI has finished. Those sessions are open until they are automatically timed-out by the system after 1800 sec.
    We have found the notes below in SAPNet:
    Note 1363751 - ICM: Java Web sessions are not terminated
    Note 1307940 - New HTTP session opened for every web service call
    However, none of them are applicable to our system because it is more updated:
    SAP PI 7.1 EHP1 SP002
    Kernel Patch Level: 87
    We have tried to close connections from the application that consumes the webservice but with no success. The sessions remain in the server until they are timed-out. Could you please tell us if this is the normal behavior of an AS Java system? Is this the way it should work? If so, can you tell us how to decrease this timeout so the inactive sessions are cleaned faster? We tried to find it but we didn't manage. Is there any way to close the session once the communication has finished?
    Thank you in advance.
    Roger Allué i Vall

    Hi Roger,
    You can do the following things to help solving your issue:
    1. Decrease session timeout default value of the web container: Use the NetWeaver Administrator
    Open Application Modules plugin within NWA
    Configuration Management -> Infrastructure -> Application Modules
    Set the desired timeout web module you are using, in minutes.
    The default value 0 in the NWA means that the value is not modified
    and the default value of 30 minutes timeout will be used.
    2. Increase the max. no. of Sessions in Configtool
    The max. number of Sessions can be set in Configtool in the Expert
    mode. There is no limitation for the parameter.
    Thanks,
    Anderson

  • Scheduled job does not stop even after the scheduling window closes

    We have written custom stats gathering job whose duration has been set as 14 hours in the schedule. This job starts daily at 6:00 PM and expected to complete upto 8:00 AM next day. But the problem is that this job continues to execute even after 14 hours. If we look at the dba_scheduler_job_run_details table, then its execution duration is about 16 - 19 hours daily. We could not understand as why it is not closed when scheduling window closes? Is there any problem with the scheduler configuration?
    select job_name
          ,program_name
          ,schedule_name
          ,schedule_type
          ,stop_on_window_close
      from dba_scheduler_jobs
    where job_name = 'GATHER_STATS_STD_JOB';
    Output:
    JOB_NAME
    PROGRAM_NAME
    SCHEDULE_NAME
    SCHEDULE_TYPE
    STOP_ON_WINDOW_CLOSE
    GATHER_STATS_STD_JOB
    GATHER_STATS_STD_PROGRAM
    GATHER_STATS_STD_SCHEDULE
    NAMED
    TRUE
    SELECT window_name
          ,schedule_owner
          ,schedule_name
          ,schedule_type
          ,start_date
          ,repeat_interval
          ,end_date
          ,duration
          ,window_priority
          ,next_start_date
          ,last_start_date
          ,enabled
          ,active
      FROM dba_scheduler_windows;
    window_name
    schedule_owner
    schedule_name
    schedule_type
    start_date
    repeat_interval
    end_date
    duration
    window_priority
    next_start_date
    last_start_date
    enabled
    active
    GATHER_STATS_STD_WINDOW
    sys
    GATHER_STATS_STD_SCHEDULE
    named
    +00 14:00:00.000000
    high
    23-feb-15 06.00.10.000000 pm +02:00
    23-feb-15 06.00.10.095878 pm +02:00
    TRUE
    TRUE
    We are using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod on Linux platform.
    Message was edited by: Moazzam

    Straight out of the docs 83 DBMS_SCHEDULER
    stop_on_window_close
    This attribute only applies if the schedule of a job is a window or a window group. Setting this attribute to TRUE implies that the job should be stopped once the associated window is closed. The job is stopped using the stop_job procedure with force set to FALSE.
    Having said that, stop_job with force applies to whether information about the job is gathered - you would have to test, but I believe that the statistics gather will be terminated in the middle of whatever it's doing.
    Update: force says:
    force
    If force is set to FALSE, the Scheduler tries to gracefully stop the job using an interrupt mechanism. This method gives control back to the slave process, which can update the status of the job in the job queue to stopped. If this fails, an error is returned.
    If force is set to TRUE, the Scheduler will immediately terminate the job slave. Oracle recommends that STOP_JOB with force set to TRUE be used only after a STOP_JOBwith force set to FALSE has failed.

  • Webcam is not working even after I reinstall the system software

    My webcam is not working even after I reinstall the system software.
    My questions are follows:
    Should I bring it to repair or get a external webcam?
    At approximately how much would be cost for repair?
    Which webcam I should get?
    Thank you very much!
    Tian

    Update, I fixed it although it feels more like a workaround. I had to enable the extension in extension manager. That still left a blank panel, but once I closed and reopened the panel I was prompted to login. Seems that closing and reopening the panel is the fix once it is enabled.

  • Iphone 4 front camera not working even after reboot,resets and restore.

    i am using iphone 4 .I have problem that front camera is not working even after reboot,resets and restore with itunes.I thing there is a hardware problem.
    Now i wont to go apple store for replace the phone because phone is under warranty period.But problem is that i lost the receipt.Will apple store help me without my receipt ?please help me

    If setting up as new device without using the latest backup does not bring the camera function back, get it looked at or serviced by Apple:
    How to back up your data and set up as a new device
    Apple - Support - Service Answer Center

  • Why can I not disable the guest user in the 10.8.2 update? I have never enabled the guest user, but after the update, it was automatically enabled with a "managed" tag. It is not selectable even after entering my admin password to unlock the options.

    Why can I not disable the guest user in the 10.8.2 update? I have never enabled the guest user, but after the update, it was automatically enabled with a "managed" tag. It is not selectable even after entering my admin password to unlock the options. I was able to select the account under "parental controls", but again, could not delete it. Why Apple? Why?!!????

    SOLVED Ok. I actually was able to disable it. I had to actually log in as the guest user to make it accessible in the preference window. Then I disabled it and logged out. Apologies if this was obvious for some people, but I have had some sort of issue with something every update since Snow Leopard.

  • My iPod Touvh 4th Generation won't turn on. It will not charge even after I used a few chargers and will not connect to a computer. The Home button is broken and I don't know if the Lock/Sleep button is now broken or stuck as well. What should I do?

    My iPod Touvh 4th Generation won't turn on. It will not charge even after I used a few chargers and will not connect to a computer. The Home button is broken and I don't know if the Lock/Sleep button is now broken or stuck as well. I believe there may be a problem with the battery or the backlight. I've had my screen replaced once by some stooges. What should I do?

    Try:
    - iOS: Not responding or does not turn on
    When it  says place the iPod in recoverymode use one of these programs.
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    and                                  
    RecBoot tip
    For MAC or PC       
    The Firmware Umbrella - TinyUmbrella
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • CS5.5 and OSX 10.9.4: Most applications will not launch even after uninstalling and reinstalling the Creative Suite 5.5. After my 2011 MacBook Pro 17 died, I had to purchase a new MacBook Pro 15 to replace it.  I performed a Time Machine installation from

    CS5.5 and OSX 10.9.4: Most applications will not launch even after uninstalling and reinstalling the Creative Suite 5.5. After my 2011 MacBook Pro 17 died, I had to purchase a new MacBook Pro 15 to replace it.  I performed a Time Machine installation from that 2011 machine, and only Distiller and Acrobat would launch (none of the rest of the creation apps).  So I ran the CS5.5 installer, uninstalled, then reinstalled, producing the same result. When I try to launch, nothing happens.  What next?

    Try...
    Adobe Creative Suite Cleaner Tool
    helps resolve installation problems for CS3 thru CS6 and for Creative Cloud
    http://www.adobe.com/support/contact/cscleanertool.html

  • Social App not working even after update from noki...

    nokia n8 social loading feeds.
    My wife and i have the same problem now, only last week she said my phone will not work on facebook the widget on main home screen will not load feeds at all, and the widget is now blank saying refresh all the time, so i linked the phone up to the computer and did a scan for new updates with nokia updater which you can download from nokia site.
    Its now the 4th jan and the phones still will not work even after and update from a socail app,
    nothing , facebook will load after a few pushes, and looks like its loading till it says loading feeds then it says the (wording unable to load news feeds) 

    Uninstall the social app and reboot your phone. Then go to software updates and reinstall from the offering given in the updates. I've uninstalled and reinstalled social twice and it has worked both times.
    blitZkid
    Nokia C7: Running on Nokia Belle
    "If I'm helpful in anyway, a click of appreciation on the star would be nice"

  • The g, h and backspace on my keyboard are not working even after replacing with a new one.

    The g, h and backspace on my keyboard are not working even after replacing with a new one. I have also updated my BIOS still d same. Please help me ASAP.
    ...am waiting for a QIUCK RESPONSE

    How does a usb keyboard attached externally work?
    You might try a "hard reset" where you remove battery and AC charger, hold down power button 20-30 seconds and then reassemble and turn on. Reset BIOS (F10) to default settings, too. 

  • After installing iOS6, my Maps are not working at all, anything i search it says "result not found" even after placing a pin and selecting "Direction to here" i get the same result not found. Very disappointed with the new iOS

    After installing iOS6, my Maps are not working at all, anything i search it says "result not found" even after placing a pin and selecting "Direction to here" i get the same result not found. Very disappointed with the new iOS.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • Change Button Not Active even after Delivery Completion Indicator is Remove

    Hi ,
    In SRM 5.0 ,Change Button Not Active even after Delivery Completion Indicator is Removed for Completed PO to cancel the GR or make changes.
    Thanks & Regards,

    Hi,
    Please check these notes.
    Note 1267916 - PO item flags do not stay checked
    Note 1174982 - Return/deletion of confirmation does not update the PO flag
    Thanks
    Zameer

  • Hi tutor,my system preferences remains in hang and it does not respond even after force quit.May i have a advice la

    my sytem preferences remains in hang and is not responding even after force quit,may i have suggestion la

    Hello: Welcome to Apple Support Communities!
    Could you specify the Mac OS X version and also what computer you
    are using it on, with some detail? Some of these kinds of issues, while
    they may seem the same across various years of OS X, can have
    different causes and also different cures.
    With that information, someone may be capable of researching a reply
    most suited to try & see if it works in your computer + OS X system.
    One idea, which may/may not help, would be to start the computer
    from its most recent OS X DVD install disc, unless it has OS X 10.7
    or Later, where there is a Recovery partition on the HDD to boot from.
    Then use Disk Utility> repair disk, while there, also repair permissions.
    Thanks.
    Good luck & happy computing!

  • Permissions will not set, even after using terminal commands?

    Hey,
    I found a thread on here for using the terminal to type in commands for the user permissions and for the PSIX permissions on Leopard (10.5) server.  These commands are supposed to clean the server of all underlying(hidden) permissions that you cant see and then you are supposed to be able to then set the permissions again and finally, to hit "Propagate Permissions" so that all the permissions set for the shared volume then get farmed out to all sub files/folders.  This did not work when I tried it in the terminal, it said "Command not found" even after I typed in the admin password.  Is there anyone out there who can tell me the actual way to fix the old permissions and get new ones set?
    The story is:  We had an old server on a G4 when i first took control of the server, I took the shared hard drive out of the G4 and inserted it into a G5 and started using it with the leopard server.  the permissions did not really need to be set on that volume because they had carried over from the last time they were shared.  But we recently just got a Drobo unit for our server and I recently transferred all the shared files and folders over to the new volume, but ever since I cant get the permissions to farm out to all the stations, it shows me that its done on the server.  But when I go to access the files I am able to delete faculty folders where I had set the permissions to "read only" so I am wondering if there is a streamlined way of going about this or if I should just start from scratch and use all brand new HDD's?
    Please Help!

    Hi ..
    Try the tips mentioned here > Mini-tutorial: Force-deleting stubborn or problematic files in Mac OS X

Maybe you are looking for

  • Best practice for version control B2B, ESB and BPEL

    Hello, we are setting up a new system using B2B, ESB and BPEL. The development team is more experienced working with PL/SQL, Oracle Workflow and we are worried that Jdeveloper generates changes to the source files during development and that we might

  • How to add F1 help for a Radiobutton in a report

    Hi Experts, I have created a report in which I defined 4 radiobuttons. Now I want that whenever user selects any of the radiobutton and press F1, a documentation corresponding to that radiobutton should come be displayed. Please give me the ideas on

  • Logic will not playback audio unless movie is visible?

    Hello everyone, I've scored many movies in Logic and except for running out of horsepower have never had a problem like this...until today. The problem: Whenever I dont have the movie visible, ALL audio stops!! Its not just this new project, but all

  • Slow motion Huge Bugs IOS 8.1 Iphone 6 Plus

    When you shoot in either of the two slow motion speeds and plays back ok on phone.  I put the files in the computer (grab the raw file via explorer), on Win 7 Professional, and played with both windows media player AND Quicktime player (up to date pl

  • Certification of Oracle 8i r2

    Hi, for which Linuxplatforn is Oracle 8i Release 2. certified? In the Documentation is a reference to the Linux FAQ, but there is no information about this matter. Thanks for answers