All current Sessions in a ServletContext

Does anybody knows what is the easiest way to
get information about all current client sessions
for a particular ServletContext.
All methods that could offer such information are
depricted. Is there a substitute way of doing it?
It would be handy for example to be able to implement
servlet that would give the administrator of the site
information about all currently logedon users.
Milan
d o L i t h e . c o m
http://www.dolithe.com

Not sure if this is easy or a good thing, but it is possible.
At the top of your JSP pages, put the following code.
<%
  HashMap sessionTable = null ;
  if( application.getAttribute("com.x.currentsessions" ) != null )
       sessionTable = (HashMap)application.getAttribute("com.x.currentsessions") ;
  else
       sessionTable = new HashMap() ;
  sessionTable.put( session.getId(), session ) ;
%>Now, you can create a simple page that displays the HashMap from the ServletContext, thus browsing the current session contents. I would, however, on that browse page, remove all sessions that have been invalidated so you can reclaim that memory. Anyone know how to check that?

Similar Messages

  • Listing all current sessions -- Please Helpppp!!!

    I need to be able to list all of the current sessions on my computer. I need to find the name of a session so that I can pull the username from it. How can I get a list of all sessions? Is there a way to disable all the sessions, and then go in and create the session I need? Please Help!!

    I don't know what these "sessions" are, but if they are outside of your Java program and controlled by your operating system, the answer is that pure Java can't do that. The usual cop-out here is that you can use JNI to do it.

  • My software is STUCK on "Retrieving current session status" What is this and how do I fix it? i am not able to convert any files at all!! Please help!

    My software is STUCK on "Retrieving current session status" What is this and how do I fix it? i am not able to convert any files at all!! Please help!

    Hi JulietaQ,
    In order to help you better.
    Please let me know which application or Service of Adobe you are using. If this is subscription i would request you to log-out and log-in back and let me know if that helps.
    ~Ajlan Huda

  • I want to get List of all active sessions in current system

    Hi experts
    How to get list of all active sessions in current system in any internal table along with details.
    A sample code wud be helpful
    Thanks in advance.

    try this code it might help u.
    Below report execution gets the active Session list to ABAP memory
    submit rsm04000_alv and return exporting list to memory.
    refresh: gt_listobj.
    Below FM get the List output from ABAP memory to gt_listobj in HEX
    call function 'LIST_FROM_MEMORY'
      tables
        listobject = gt_listobj
      exceptions
        not_found  = 1
        others     = 2.
    if sy-subrc <> 0. " Executed successfully ?
      message id sy-msgid type sy-msgty number sy-msgno
      with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    This FM converts ITAB gt_listobj from HEX to ASCII
    call function 'LIST_TO_ASCI'
      tables
        listasci           = it_list
        listobject         = gt_listobj
      exceptions
        empty_list         = 1
        list_index_invalid = 2
        others             = 3.
    if sy-subrc <> 0. " Executed successfully ?
      message id sy-msgid type sy-msgty number sy-msgno
      with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    This Shows the output in List format on screen
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
       i_structure_name                  = 'line'
      tables
        t_outtab                          = it_list
    exceptions
       program_error                     = 1
       others                            = 2.
    if sy-subrc <> 0. " Executed successfully ?
    message id sy-msgid type sy-msgty number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.

  • Performance tuning: lite sessions and local ServletContext

    I have been doing some research on iPlanet performance tuning. In our
    current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
    we don't use clustering there should be a couple of performance improvements
    we can make immediately:
    1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
    believe that if you use lite sessions, the session data is stored in the kjs
    process space as opposed to the kxs process space. This, of course, means
    that if a kjs dies the user's on it will lose their session information but
    it will provide a performance improvement by reducing kxs/kjs communication.
    2. Use local ServletContexts (<distributable>false</distributable> in
    web.xml) - This should cause the ServletContext to only be stored in the
    originating JVM. So again, if a kjs dies, the user will lose their
    ServletContext but again we will get a performance improvement by reducing
    kxs/kjs communcation.
    What I want to understand is how our load balancing configuration will
    effect our production environment if we use this configuration. Right now
    we use sticky load balancing on all our servlets but we don't have our JSPs
    registered and therefore sticky load balancing cannot always be trusted to
    return users to the iAS they came from. We make up for this by using
    hardware load balancing that keeps the majority of our users sticky.
    However, using lite sessions and local ServletContexts will require that a
    user not only stick to an iAS, but to a specific kjs as well. Using sticky
    load balancing would ensure that, but since we also rely on our hardware
    load balancers, could they create a problem? If a user gets sent back to
    the iAS they came from by our hardware load balancers, will the kxs process
    be smart enough to return them to the kjs they came from? If so, then I
    think that means that we can safely switch to lite sessions and local
    ServletContexts, but if not, I think many users will lose their sessions.
    Thanks,
    Linc

    Please follow thru this link for your answers
    http://developer.iplanet.com/viewsource/char_tuningias/index.jsp
    Thanks
    Shital Patel
    Lincoln wrote:
    I have been doing some research on iPlanet performance tuning. In our
    current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
    we don't use clustering there should be a couple of performance improvements
    we can make immediately:
    1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
    believe that if you use lite sessions, the session data is stored in the kjs
    process space as opposed to the kxs process space. This, of course, means
    that if a kjs dies the user's on it will lose their session information but
    it will provide a performance improvement by reducing kxs/kjs communication.
    2. Use local ServletContexts (<distributable>false</distributable> in
    web.xml) - This should cause the ServletContext to only be stored in the
    originating JVM. So again, if a kjs dies, the user will lose their
    ServletContext but again we will get a performance improvement by reducing
    kxs/kjs communcation.
    What I want to understand is how our load balancing configuration will
    effect our production environment if we use this configuration. Right now
    we use sticky load balancing on all our servlets but we don't have our JSPs
    registered and therefore sticky load balancing cannot always be trusted to
    return users to the iAS they came from. We make up for this by using
    hardware load balancing that keeps the majority of our users sticky.
    However, using lite sessions and local ServletContexts will require that a
    user not only stick to an iAS, but to a specific kjs as well. Using sticky
    load balancing would ensure that, but since we also rely on our hardware
    load balancers, could they create a problem? If a user gets sent back to
    the iAS they came from by our hardware load balancers, will the kxs process
    be smart enough to return them to the kjs they came from? If so, then I
    think that means that we can safely switch to lite sessions and local
    ServletContexts, but if not, I think many users will lose their sessions.
    Thanks,
    Linc

  • How can I get information of all the sessions opens for my application

    I have a record of all sessions ids created and what I need to know in certain circunstances if the session is still alive comparing by session id
    I hope you can help me.
    Thanks.....
    Edited by: Daniel Almaguer on 23-may-2012 11:28

    in weblogic console.. Go to Summary Of Deployments.. and select the Monitoring tab -> Web Application..
    This will give you these information for the particular application
    Context Root Sorted Ascending      State      Active Server Count      Source Information      Current Sessions      Maximum Sessions on Any Server      Total Sessions

  • SQL query to get the current session info

    I've a query in my application to view the all the sessions within database
    select
    substr(a.spid,1,9) pid,
    substr(b.sid,1,5) sid,
    substr(b.serial#,1,5) ser#,
    substr(b.machine,1,6) box,
    substr(b.username,1,10) username,
    -- b.server,
    substr(b.osuser,1,8) os_user,
    substr(b.program,1,30) program
    from
    v$session b,
    v$process a
    where
    b.paddr = a.addr
    and type='USER'
    order by spid;
    Can someone help me with a query to view the info of the session where I'm in currently?
    Thanks,
    Gabriel Stephen.

    here's one way to do it.
    select
       substr(a.spid,1,9) pid,
       substr(b.sid,1,5) sid,
       substr(b.serial#,1,5) ser#,
       substr(b.machine,1,6) box,
       substr(b.username,1,10) username,
       -- b.server,
       substr(b.osuser,1,8) os_user,
       substr(b.program,1,30) program
    from
       v$session b,
       v$process a
    where
       b.paddr = a.addr
       and type='USER'
       and b.sid=(select sid from v$mystat where rownum=1)
    order by spid-------------
    Anwar

  • How to get the transaction_id from the current session of the current trx?

    Hello Gurus,
    How can get the hr_api_transactions.transaction_id from the current session to use it in my SQL script in VO.xml?
    I don't know if I can get the item_type, item_key from the current self service session in iRecruitment? to use it in hr_transactions_ss.get_transaction_id(p_item_type, p_item_key)
    I saw something icx_sec.getID(icx_sec.g_transaction_id)!
    Can I use this in the where clause of the SQL part of my VO extension?
    Thanks for all the help!
    FR

    Hi!
    Try this thread:
    http://help.sap.com/saphelp_nw04s/helpdata/EN/80/b2dd3a6dac703be10000000a11405a/frameset.htm
    brgs Ziggy

  • How to keep track of the users who are all currently logged in

    Hi All,
    I have basic knowledge of Session and Servlets. I am wondering how to keep track of the users who are all currently logged in. There should be some way of achieving it.
    I thought of it and come up with having an Application variable that hold it when ever a user successfully logged in.
    Thanks in advance for any reply.

    You can do this by keeping data in a static veriable in a some class of yours. The variable will need to be a collection.
    Whenever a user loogs in to the site a servlet/jsp should put the users information in to the collection and when logs off or when the session expires the entry should be take off.
    You can achive this by storing the velues in a some sort of a week collection where the entries are automaticaly removed when all the other refferences to the entry goes out of scope.
    You might need to read bit about java.lang.ref package and WeekReference
    Or you can make the entry in the collection contain the last time that the user visited any of the pages and a thread can run time to time and clean up the older entries which have timed out

  • Open URL Ivew in a new window without loosing the current session in Portal

    Hi All ,
    I have a requirement in which there are two tabs in portal which are two roles A and B
    Where each tabs(role) has an URL Iview attached to it.
    Current I am in Window 1 - Tab A
    When I click on Tab B, it has to open in a new window (Window2) with Tab B content , where as the previous session (Window1)is not lost and Window1 has to show Tab A only.
    Kindly help me out on how to implement it .
    Thanks in Advance

    Hi All ,
    Thanks for the reply and sorry for the late response. 
    As per Prashant  I made the setting .. When I click Tab 2 in Window 1,  opens  a new window 2 with Tab 2 iview .but the window 1 is hilighted with Tab B and the current session on Tab A is lost . As per the reqiirement I should not loose the focus on Tab A in Window1.
    also Kindly let me know how and where can I sent the EPCM paramenter for the URL Iview .
    Thanks in Advance
    Edited by: Prasanna Kumar on Feb 21, 2012 12:42 PM

  • Where's the button which shows the browsing history of the current session?

    On previous versions there was right next to the back button a small down-upwards pointing button which opened the whole browsing history of the current session. It was helpful to pick the page (site) you needed in an instant instead of going through all pages back in a tedious manner. What's up with this new Firefox version? It has serious issues,for Christ's sake...!

    Thank you! I didn't know about the fact that one can open such a window with a right click on the back button =O oh well,I just installed the add-on since I'm used to this upward-down pointing arrow =) Thanks a lot! Firefox seriously messed it up this time,but thanks to guys like you I will stay for a little while longer with our fiery fox friend =)

  • HOw to find number of bind variables declared in current session

    Hi All,
    I want know a query to find out the number variables declared in current session.

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated [SQL And PL/SQL|https://forums.oracle.com/forums/forum.jspa?forumID=75] forum (you've posted there before).
    Regards,
    K.

  • Java API & E 6.5.1: Retrieving current session ID after calling IEssOlapServer.connect()

    Is it possible to retrieve the current session ID after connecting using IEssOlapSvr.connect()?I know that you can: 1)Get all of the requests via IEssOlapServer.getRequests2) Iterate through the result of getRequests to get a request object 3) Use IEssOlapRequest.getRequestCode() to get the session id for the request. This is problematic because if I must loop through all of the requests/sessions, I cannot guarantee the one I am looking for is the one I am currently in!! As soon as a request/session is created in a thread, I would like to store the session id in a database so I can do 'stuff' with the session id later (like cancel it, etc). Does anyone have any thoughts? Hopefully I am over-looking something simple!!

    Why don't you just keep a handle on the object and use that for further operations?Tim TowApplied OLAP, Inc

  • Kill all oracle session

    Situation:
    Oracle Forms 9i application, with multiple oracle forms (MDI). When I call a new forms I use OPEN_FORM(v_cm_module, ACTIVATE, session, pl_id) so I create a new oracle session.
    Problem:
    The user open a lot of windows (oracle forms .fmx with diferent sessions each one) in the oracle forms application, when they close the browser window (X botom of the browser, mozilla, internet explorer), the session are still alive (only kill one session....the first I think).
    I know that after 15 minutes oracle kill the rest of the sessions, but if the user was editing a block (locking a record), and close the browser, the table still lock 15 minutes!!!!.
    Any sugestions:???
    Thanks

    Is it necessary to create a session for each form?
    If so you could do the following:
    in the formsweb.cfg set the seperateframe property on true; and place some JavaScript code into the htmlafterform property:
    HTMLafterForm=<script type="text/javascript"> window.moveTo(-10000, -10000); </script>
    now you have a seperate frame, the browser window gets moved to a position where you can't see it ;-). when clicking the X button in the seperate frame the current form will be closed; your MDI application is still running...if you wan't you can write a JavaBean, and get the windowlisteners of the seperate frame and replace them with your own...of course you can close the Browser by right clicking and closing it in the taskbar; but that's a thing you must live with...
    besides that I have no clue how to get rid of those sessions, as I don't you have any event you can act with when closing the Browser. But if so you could save every sid in every when-new-form-instance trigger (you can get it from v$mystat), and when this event occurs you could kill all those sessions (alter system kill session ....) ;-). but as far as I know that's not possible...
    regards
    christian

  • Have script use current session

    Hello,
    I am an SAP end user and do not have a programming background, but am teaching myself VBScript to automate some processes.  I have learned quite a bit through reading through the posts on the forums, but I can not figure out how to get the scripts that I write to run on the current sap session.    They always run on the first session that is opened. 
    It seems like there must be something that can be written in the script to use the current session vs the 1st session that is opened.   I have found a few threads on the forums that make mention of this problem, but have not found a solution that works.
    Any help would be greatly appreciated.

    Hi Scriptman,
    I have learned a lot reading from your previous posts on various subjects.   Here is the start of the script just up to the point where it gets the title of the transaction.  It always runs on first session created unless I change the children number to reflect the session that I want it to run on.
    If Not IsObject(application) Then
       Set SapGuiAuto  = GetObject("SAPGUI")
       Set application = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(connection) Then
       Set connection = application.Children(0)
    End If
    If Not IsObject(session) Then
       Set session    = connection.Children(0)
    End If
    If IsObject(WScript) Then
       WScript.ConnectObject session,     "on"
       WScript.ConnectObject application, "on"
    End If
    trans = session.findById("wnd[0]/titl").text
    I have tried a couple scripts that you have previously posted and the one that comes closest to doing what I want is :
    If Not IsObject(application) Then
       Set SapGuiAuto  = GetObject("SAPGUI")
       Set application = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(connection) Then
       Set connection = application.Children(0)
    End If
    msgbox "Please select a session within the next 3 seconds after clicking ok"
    wscript.sleep 3000
    set session = application.ActiveSession
    trans = session.findById("wnd[0]/titl").text
    I would like it to just run on the last session that the user was last accessing without them having to click on the session to activate it after the script is running.  Do you know of any way to do this or if it is possible?
    Thanks again for all the great information that you have already posted.

Maybe you are looking for

  • Hi. I have (stupidly) managed to create two iCloud accounts.... How can I merge these?

    Hi guys.. Can anyone help me merge these two accounts or take sensible steps to get rid of one account.. So that I can see all my music from one account?

  • System freezes after the 10.9.3 update

    Hello New MacBook Pro, 15", 2.3 GHz, 16GB RAM, 1TB SSD After the update to 10.9.3, the system hangs several times a day. Sometimes the freeze continues for about a minute and then the machine gets back to normal, sometimes it does not - then only har

  • Customer master Query report doesnt pick all the customer account groups

    Hello experts We have a custom Query report created using customer master tables KNA1,KNVV,KNB1 etc. We have customers maintained under 5 customer account groups. One of the selection fields in the query is account group. But it displays customers on

  • Highlight words by regex in pdf files

    I want to highlight words by regex in pdf files. Could somebody let me know if there is an automatic way to do so with some third party software (I don't find a way to do it in acrobat)?

  • Premiere Pro CS6 sequence in to AE CS6

    Hi all, I have a question about importing Premiere sequences in to After effects. I know you can use the dynamic link stuff to import a sequence but it comes in as one whole sequence. In previous versions you could import it as a composition and see