Session managing testing servlets

I am running two 5.1 sp1 servers in a cluster using in-mem replication
          with a wl proxy server, all on NT boxes. I've written three servlets:
          Login, Logout, and Test2
          Login creates a new session if one isn't present. Logout kills the
          session if there is one present. Test2 tests for the existence of a
          session.
          -- I start the server and create a new session with the Login
          servlet.
          -- I test with Test2 servlet ( I get Test2: init) and it doesn't see
          the session I had just created.
          -- I reload Test2 and it recognizes the session OK.
          -- It recognizes the session with all subsequent calls to it as well.
          -- Killing the server and making the session failover to another
          server will make the Test2 servlet not see the session for the first
          time again (If that is the first time that the servlet is loaded on that
          particular server).
          Same happens with Logout servlet. It seems that when a servlet is
          initially loaded on a server it doesn't see sessions already present but
          it picks up that info on all subsequent loads. What can I do to make
          sure all my servlets see all the sessions all the time (otherwise this
          failover demo I'm doing is quite useless).
          Thanks, Timur
          

          Prasad Peddada wrote:
          > Timur Maltaric wrote:
          >
          > > Say I had two servers in the cluster to begin with. Sessions were created and killed as users logged on and off.
          > > One server dies suddenly and one is left operating in the cluster. Shouldn't this one that is operating be able to
          > > correctly handle any new sessions that will be created?
          >
          > Yes.
          >
          > From your earlier mail:
          >
          > The log attached to an earlier message shows that Login servlet starts a new session, and writes a cookie. Good.
          > Requesting Test2 doesn't read that cookie and returns session = null. Requesting Test2 again reads the cookie
          > correctly and gets the correct session information.
          >
          > From the log files:
          >
          > Tue May 30 10:17:42 EDT 2000:<D> <ServletContext-General> Found servlet for Virtual Path: '/Test2'
          > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: ServletPath: /Test2
          > Tue May 30 10:17:42 EDT 2000:<D> <ServletContext-General> Invoking servlet
          > Tue May 30 10:17:42 EDT 2000:<D> <ServletContext-General> Checking ACL: weblogic.servlet.Test2
          > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> Parsing cookies
          > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: Found cookie:
          > javax.servlet.http.Cookie@b8f4916
          > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: SessionID:
          > OTPNVO0XpIhya1eIDpzrNar9gwDuzpm198DEKR9ho5uhKqSfIOis7UdLQ0773aTGodGkgNoKH0A3|-5241978140997784602/168297227/6/7001/7001/7002/7002/7001/-1|NONE|-5241978140997784602
          > found in cookie
          > Tue May 30 10:17:42 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: Trying to find session:
          > OTPNVO0XpIhya1eIDpzrNar9gwDuzpm198DEKR9ho5uhKqSfIOis7UdLQ0773aTGodGkgNoKH0A3|-5241978140997784602/168297227/6/7001/7001/7002/7002/7001/-1|NONE|-5241978140997784602
          >
          > Contrary to what you said the weblogic server is reading your session. All the requests are in the same session.
          The first time (notice time) that the request is made for Test2 weblogic server is NOT reading the session info. Second request for Test2 (one you quoted) is OK.
          Why?:
          Tue May 30 10:17:13 EDT 2000:<D> <ServletContext-General> Found servlet for Virtual Path: '/Test2'
          Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: ServletPath: /Test2
          Tue May 30 10:17:13 EDT 2000:<D> <ServletContext-General> Invoking servlet
          Tue May 30 10:17:13 EDT 2000:<D> <ServletContext-General> Checking ACL: weblogic.servlet.Test2
          Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> Parsing cookies
          Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: Get query parameter: WebLogicSession found value: null
          Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> ServletRequestImpl: SessionID not found
          Tue May 30 10:17:13 EDT 2000:<I> <ServletContext-General> Test2: init
          >
          > Contact support if you have a reproducible test case and we will go from there.
          I am contacting support.
          >
          >
          > I don't think it matters how many servers are in the cluster because none are really failing. Correct me if I'm wrong.
          >
          > True.
          >
          > - Prasad
          >
          > >
          > > Timur
          > >
          > > Prasad Peddada wrote:
          > >
          > > > If you have only one server in the cluster how do you expect it to failover and retrieve your session
          > > > information.
          > > >
          > > > - Prasad
          > > >
          > > > Timur Maltaric wrote:
          > > >
          > > > > There was only one server running in the cluster when these requests were made. That shouldn't be a problem
          > > > > though.
          > > > >
          > > > > Timur
          > > > >
          > > > > Prasad Peddada wrote:
          > > > >
          > > > > > The same cookie is being sent five times as you can see. Are you sure your clustering is
          > > > > > working. I don't think the servers are recognizing each other. Do you have two servers
          > > > > > running when you made these requests.
          > > > > >
          > > > > > C:\TEMP>grep
          > > > > > "OTPNVO0XpIhya1eIDpzrNar9gwDuzpm198DEKR9ho5uhKqSfIOis7UdLQ0773aTGodGkgNoKH0A3|-5241978140997784602/16829722
          > > > > >
          > > > > > 7/6/7001/7001/7002/7002/7001/-1|NONE|-5241978140997784602" weblogic.log | wc -l
          > > > > > 5
          > > > > >
          > > > > > - Prasad
          > > > > >
          > > > > > Timur Maltaric wrote:
          > > > > >
          > > > > > > Here is a snippet from the log. Test2 doesn't recieve the cookie on first load but
          > > > > > > recieves it thereafter.
          > > > > > >
          > > > > > > Timur
          > > > > > >
          > > > > > > Prasad Peddada wrote:
          > > > > > >
          > > > > > > > I don't think domain property applies to your case. Did you try turn on the
          > > > > > > > debugging and did you notice anything wrong. When you requested Login, you should
          > > > > > > > have got a cookie that should have been passed back when you requested Test2. Do
          > > > > > > > you see that in log?
          > > > > > > >
          > > > > > > > - Prasad
          > > > > > > >
          > > > > > > > Description about domains:
          > > > > > > >
          > > > > > > > When searching the cookie list for valid cookies, a comparison of the domain
          > > > > > > > attributes of the cookie is made
          > > > > > > > with the Internet domain name of the host from which the URL will be fetched.
          > > > > > > > If there is a tail match, then
          > > > > > > > the cookie will go through path matching to see if it should be sent. "Tail
          > > > > > > > matching" means that domain
          > > > > > > > attribute is matched against the tail of the fully qualified domain name of
          > > > > > > > the host. A domain attribute of
          > > > > > > > "acme.com" would match host names "anvil.acme.com" as well as
          > > > > > > > "shipping.crate.acme.com".
          > > > > > > >
          > > > > > > > Only hosts within the specified domain can set a cookie for a domain and
          > > > > > > > domains must have at least two (2)
          > > > > > > > or three (3) periods in them to prevent domains of the form: ".com", ".edu",
          > > > > > > > and "va.us". Any domain that fails
          > > > > > > > within one of the seven special top level domains listed below only require
          > > > > > > > two periods. Any other domain
          > > > > > > > requires at least three. The seven special top level domains are: "COM",
          > > > > > > > "EDU", "NET", "ORG", "GOV", "MIL", and
          > > > > > > > "INT".
          > > > > > > >
          > > > > > > > The default value of domain is the host name of the server which generated
          > > > > > > > the cookie response.
          > > > > > > >
          > > > > > > > Timur Maltaric wrote:
          > > > > > > >
          > > > > > > > > weblogic.httpd.session.cookie.domain
          > > > > > > > >
          > > > > > > > > what does this do? What should I set it to?
          > > > > > > > >
          > > > > > > > > Prasad Peddada wrote:
          > > > > > > > >
          > > > > > > > > > Turn on the weblogic.debug.httpd=true and see if the cluster's are receiving
          > > > > > > > > > cookie's or not and try with IE as well.
          > > > > > > > > >
          > > > > > > > > > Try setting this property on the weblogic servers in the backend and see if
          > > > > > > > > > it helps.
          > > > > > > > > >
          > > > > > > > > > weblogic.httpd.session.cookie.domain
          > > > > > > > > >
          > > > > > > > > > - Prasad
          > > > > > > > > >
          > > > > > > > > > Timur Maltaric wrote:
          > > > > > > > > >
          > > > > > > > > > > I am running two 5.1 sp1 servers in a cluster using in-mem replication
          > > > > > > > > > > with a wl proxy server, all on NT boxes. I've written three servlets:
          > > > > > > > > > > Login, Logout, and Test2
          > > > > > > > > > > Login creates a new session if one isn't present. Logout kills the
          > > > > > > > > > > session if there is one present. Test2 tests for the existence of a
          > > > > > > > > > > session.
          > > > > > > > > > >
          > > > > > > > > > > -- I start the server and create a new session with the Login
          > > > > > > > > > > servlet.
          > > > > > > > > > > -- I test with Test2 servlet ( I get Test2: init) and it doesn't see
          > > > > > > > > > > the session I had just created.
          > > > > > > > > > > -- I reload Test2 and it recognizes the session OK.
          > > > > > > > > > > -- It recognizes the session with all subsequent calls to it as well.
          > > > > > > > > > >
          > > > > > > > > > > -- Killing the server and making the session failover to another
          > > > > > > > > > > server will make the Test2 servlet not see the session for the first
          > > > > > > > > > > time again (If that is the first time that the servlet is loaded on that
          > > > > > > > > > > particular server).
          > > > > > > > > > >
          > > > > > > > > > > Same happens with Logout servlet. It seems that when a servlet is
          > > > > > > > > > > initially loaded on a server it doesn't see sessions already present but
          > > > > > > > > > > it picks up that info on all subsequent loads. What can I do to make
          > > > > > > > > > > sure all my servlets see all the sessions all the time (otherwise this
          > > > > > > > > > > failover demo I'm doing is quite useless).
          > > > > > > > > > >
          > > > > > > > > > > Thanks, Timur
          > > > > > > > > >
          > > > > > > > > > --
          > > > > > > > > > Cheers
          > > > > > > > > >
          > > > > > > > > > - Prasad
          > > > > > > >
          > > > > > > > --
          > > > > > > > Cheers
          > > > > > > >
          > > > > > > > - Prasad
          > > > > > >
          > > > > > > ------------------------------------------------------------------------
          > > > > > > Name: weblogic.log
          > > > > > > weblogic.log Type: Text Document (application/x-unknown-content-type-txtfile)
          > > > > > > Encoding: base64
          > > > > >
          > > > > > --
          > > > > > Cheers
          > > > > >
          > > > > > - Prasad
          [att1.html]
          

Similar Messages

  • Session management in servlet

    Hi,
    I am using OC4J Server.
    I know the session in servlet can be managed with cookies. In addition, the session can be managed in HTTP session of OC4J. And How about the URL rewriting? Does it mean there are 3 methods to keep track of the servlet session. What are the difference of them. I am quite confused.
    Thanks in advance

    I see. Thanks.
    So it means there are two kinds of cookies, permanent cookies and session cookies.
    session cookies are used to store the session information.
    I have another question. I want to write a permanent cookies to the browser and get it again even if the browser is closed.
    The source code is like:
    Cookie cookie = new Cookie(cookieName, cookieValue);
    response.addCookie(cookie);
    Then I try to write some cookies in the browser, close the browser and open the browser again and I try to retreive the cookies using the following codes but the cookies disappear.
    Cookie[] cookies = request.getCookies()
    if (cookies != null && cookies.length > 0) {
    for (int i = 0; i < cookies.length; i++) {
    Cookie cookie = cookies;
    Is this the correct way to store and retrieve permanent cookies?
    thanks in advance

  • Managed session bean in servlet filter

    Hi,
    Is there a way to get hold of a managed bean with session scope in a servlet filter? The code below throws an error due to the fact that the faces context is null.
    FacesContext facesContext = FacesContext.getCurrentInstance();
    System.out.println("facesContext: " + facesContext); // shows that facesContext is null
    ApplicationFactory appFactory = ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    Application app = appFactory.getApplication();
    Object obj = app.createValueBinding("user").getValue(facesContext); //throws the error due to the null parameter
    Object obj2 = app.createValueBinding("user"); //results in a valid ValueBindingHere is the faces-config snippet for the managed bean:
    <managed-bean>
        <managed-bean-name>user</managed-bean-name>
        <managed-bean-class>biz.libereco.skemo.info.asl.beans.User</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>For the record, I am using JSF 1.0 Final.
    Thank you,
    Marcel

    wynton_0 wrote:
    Yes, there is a way to get hold of a managed bean with session scope in a servlet filter.
    See here:
    [http://wiki.apache.org/myfaces/AccessFacesContextFromServlet]
    and here:
    [how to access faces context and backing beans in a servlet filter|http://www.thoughtsabout.net/blog/archives/000033.html]
    This makes no utter sense. A JSF session scoped managed bean is under the hood just put as a HttpSession attribute with the managed bean name as key. Guess what, you can just access the HttpSession in Filter by ((HttpServletRequest) request).getSession() and then just call getAttribute() on it. If it isn't there yet, then just do a setAttribute() with a new instance.
    After I get User bean in my Servlet filter, I populate value to this bean, for example:
    user.setLanguage(request.getParameter("locale"));
    The User bean is in session scope. The User bean's language attribute suppose to be same in the whole session scope, but later on, I got null. My question is:
    how to keep this value in session scope?The the session was apparently invalidated/renewed or you manually removed the bean or replaced it by null.
    In the future, please don't resurrect old topics, just start a new topic for each independent problem/question.

  • Servlet session managment

    Hi
    I am trying to set object in session
    first I set object in session in first servlet as session.setAttribute("name"object);
    this session obj can retrive in jsp page
    I make one link <a href="abc which call another servlet
    I want this session object can retrive in that servlet but this get null
    How yo solve this problem

    Are both the servlets in the same web app?
    Your session cannot be accessed across multiple webapps

  • Setting secure on session management cookie only in production

    I am faced with the following:
    In our developmentcycle we deliver full application exports to an acceptation environment and after testing to a production environment.
    However, only our production site does HTTPS. Development and acceptation only do HTTP.
    In production we have to set the "secure"flag on the session management cookie.
    We would like to set this flag in our deployment scripts.
    So,
    Is there an API we could use to set the "Secure" flag in the APEX metadata using SQL*Plus?

    hi
    ->Use request.getParameter(String s) to recieve the infomation from the html page into your servlet.for storing session specific info go for
    session.setAttribute(vble,value;
    hope it'll solve your problem.

  • Session Manager not thread safe

    We are running 6.0 web server with IWSSessionManager turned on. We have the failover set to true so that we always load from the persistent store.
    We had a situation where a frame set invoked 2 requests to the application. The logic in the session manager seems to be for each request:
    1) the session is loaded from the database.
    2) the new session overwrites the session in memory.
    3) the servlet/jsp uses that session.
    4) that session is persisted.
    Now.. if only one of the requests actually modifies the session then threadA and threadB have 2 session instances which have unique objects with the same session id. The last one to complete is stored in the database. This would result in data loss. (btw.. the code in question is IWSSessionManager.getSession(String id, ServletContext context)).
    Has anyone else seen this, or have we set up something really wacky?
    Thanks!
    -- bk

    c

  • Plugin based Web Service with session management

    I am trying to make a web service in java with jax-ws that should support extensions to the service without rebuilding the project. I thought it might be possible to make a standard web service and the let each plugin create their own service, making the client side plugin point to both the standard service and the plugin specific one. This way I could have user management and such in the standard service and the more plugin specific one in an other service. The problem is though, how do I make a common session for all the services? All services are running at the same server and on the same domain name.
    I checked the HTTP headers and found out that the JSESSIONID was changing when I created a new port on the client side. I was trying to implement a SOAPHandler to edit the cookie in the HTTP header, hoping that this will lead to the same session across the services. But found it hard. It was no problem reading the "Set-cookie" header, setting the cookie on the new requests was harder, as the CookieJar object seems to be internal [1]. And the MessageContext.HTTP_REQUEST_HEADERS wasn't created at the time my handlers run. Is there an easy solution to this?
    I am not sure if my idea is a good solution to the main problem, and all other ideas are more than welcome. I hope it is possible to extend the features of my server without rebuilding the project. If anything is unclear, feel free to ask :)
    [1] com.sun.xml.internal.ws.client.http.CookieJar

    Adhir_Mehta wrote:
    Could you explain plug in scenario with one example?Ok. We have not chosen exactly how to do this, but the idea is that someone may be able to extend the functionality of our server without rebuilding the project. We thought of something like a jar file with a implementation of some abstract classes. It should at least only be necessary to redeploy the project into the web container. The problem is; how do we let the plugins extend our web interface? One solution we thought of was to let each plugin have it's own service and dynamicly link to the plugin services from the main service that we provide as standard in our server. This way we may have some kind of plugin support on the clients as well, making the client side plugins know what kind of service it needs on the server side and thus extending the functionality all together.
    Hope that explains our scenario. Feel free to comment and add new ideas :)
    Regarding session management, its not advisable to manage the session in web services since that way it will become non interoperable.The documentation we found regarding sessions and jax-ws was all doing sessions with HTTPSessions, and to let the web container handle that.
    On the server side
        @Resource
        private WebServiceContext wsContext;
        private HttpSession getSession() {
            MessageContext mc = wsContext.getMessageContext();
            return ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
        HttpSession session = getSession();
        session.setAttribute("User", user);On the client side
    ((BindingProvider)port).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);Do you have other standard options for us on how to do session management? All ideas are more than welcome

  • Sending instruction directly to Siebel Communications Session Manager

    Hi.
    I am working on doing performance testing the Siebel CTI toolbar.
    I realise that the information to the CTI toolbar is coming from the Siebel Communications Session manager, which receives the information from the a CTI Middleware server.
    I want to know if I can create a stub that would send this information to the Siebel Communications Session manager, which would send the information to the CTI toolbar. Is there a set of sample commands by means of which the Siebel Commns Sessions manager receives the requests.
    Any ideas would be highly appreciated.
    Thanks.
    Krishna

    Are you positive that the CUBE is sending only 4 digits to the CUCM and that the SIP trunk in CUCM isn't configured with the Significant Digits options set to 4? I would check the SIP trunk in CUCM first. It it is configured correctly then I would use debug ccsip mess to watch the call setup flow through the CUBE. If the egress leg to CUCM shows an INVITE with only 4 digits and INVITE from the SIP provider is sending all digits then there is something in the config that you aren't showing us.
    HTH.
    -Bill (http://ucguerrilla.com)

  • Unable to initialize session manager

    Hi, We are on BOXI R2 SP3 on IIS and we are using SDK to open reports. We ran 1200 users performance testing and we got just 15 failures with the message.
    Error in RetrieveReport Internal Error:Unable to Initialize session manager
    When I open CCM using Program filesetc then I use to get same error message :"Unable to Initialize session manager". When I search for the ccm shortcut and launch that then it works fine. Now its totally missing from Program Files>> Business Objects options.
    Any idea what is the cause? Not sure if this error is related.

    This could be because previously only 512 MB was assigned to each sessions. We increased this to 1024 and we are not seeing this error message. There is a registry entry "WINDOWS"  in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems.
    In WINDOWS Key the value is "WIndows Shared Section=1024,3072,512" We made it to "WIndows Shared Section=1024,3072,1024"
    Thanks,

  • NI session manager question

    I use NI session manager to control instrument,when I get the instrumenthandle and  can testing .but my question is :
    if I close instrument power and not close NI teststand,but the teststand can run sucess ,my dll document run in demo.
    but I think there must be a error ,and the dll return value is 0. in fact ,if the instrument closed, the return value maybe a negative.
    how can I deal with it ?

    Hello Sean,
    I want to make sure I fully understand your question.  Do you have a DLL that you are calling in your TestStand sequence as a code module?  If so, does a function within the DLL return a negative number if the instrument is not powered?  Is your overall question how can you determine whether the return value from the DLL is negative and make a decision based on this result?  Thanks in advance for these answers!
    Matt G.
    National Instruments
    Applications Engineering

  • Configuration of sessions for deployed servlet, jsp, wdp

    Hello,
    I wonder how to configure session for a specific servlet. As there are several locations where to deal with session management.
    I have found the Security Provider->SessionExpirationPeriod property which is fixed to ~27 hours, this is a general parameter for all security providers.
    I need to do it per application, I have then tried to set the session in the servlet descriptor it is not taken into account.
         <session-config>
              <session-timeout>10000</session-timeout>
         </session-config>
    The security provider of the servlet is set to SAML authentication.
    Thanks for your input on this topic,
    Tanguy Mezzano

    Finally, it was that parameter.

  • Session management question

    I have a requirement to prevent multiple sessions per user id. So, when a
    user logs in to our app, any existing sessions he has must be invalidated.
    Does anyone know the correct WebLogic API call to use to locate a session
    object for a given user id? I need to call this so that I can invalidate the
    existing session.
    Thanks,
    Rob.

    Hi Rob,
    Using Servlet 2.3 features this can be done using the sessionCreated and
    sessionDestroyed API (chapter 10 of the servlet 2.3 Spec). This Spec has been
    implemented in WLS 61.
    These methods are provided by the HttpSessionListener interface and they are
    called by the container whenever a session is created or destryed as their name
    suggests. These methods take in HttpSessionEvent as their parameter which can be
    use to get a handle of the corresponding Session object. Once you get this
    handle you can store it in a Hashtable with userID as the key.
    You can use this Hashtable to verify if the session for a particular user
    already exists or not. Once the session is invalidated, the sessionDestroyed
    method will be called and this allows you to remove the session handle from the
    Hashtable. The Hashtable thus, maintains a list of active sessions in an web
    application.
    A sample impl:
    public void sessionCreated(HttpSessionEvent evt){
    sess = evt.getSession();
    /* have code to populate the sesion Attributes */
    log("\nsession created " + sess.getId() );
    log("Session id: " + sess.getAttribute("userID") );
    synchronized(this) {
    h.put(sess.getAttribute("userID"), sess);
    public void sessionDestroyed(HttpSessionEvent evt){
    sess = evt.getSession();
    log("\nsession destroyed: " + sess.getId() );
    synchronized(this) {
    h.remove(sess.getAttribute("userID"));
    hope this helps,
    mihir
    Rob Worsnop wrote:
    OK. I posted the original message after speaking to BEA tech support. They
    had told me there was an API for getting hold of the session. Now they tell
    me there is not.
    It looks like I have to implement this particular aspect of session
    management myself.
    It's a pretty simple task - provided you expect no more than a few hundred
    users logged on at a particular time.
    Anyone got any tips about how to implement this in scalable manner?
    Thanks,
    Rob.
    "Rob Worsnop" <[email protected]> wrote in message
    news:[email protected]...
    I have a requirement to prevent multiple sessions per user id. So, when a
    user logs in to our app, any existing sessions he has must be invalidated.
    Does anyone know the correct WebLogic API call to use to locate a session
    object for a given user id? I need to call this so that I can invalidatethe
    existing session.
    Thanks,
    Rob.

  • How to set default value of session management alert

    Dear Sir,
    Our server is EP7 , I would like to set the default value of session management alert to be "OFF". Because now the default value of session management alert to be "ON".  And I must manual set when the server start every time.
    Please kindly advise.
    Thank you and best regards,
    Vimol

    Hi,
    There is also a SAP note which explains this:
    SAP Note Number: [868477 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_ep_pin/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d383638343737%7d]
    Regards,
    Praveen Gudapati

  • NI Session Manager gets slower and slower from call to call!

    I have the following problem with NI-Session-Manager:
    I use Session Manager a lot on my test systems. Now that I have a test system running that makes many Session Manager Calls I noticed that after a while the system gets slower and slower. I�ve attached a Sequence File, which demonstrates this problem.
    This sequence file is based on the LV Session Manager Example, which ships with TestStand.
    Instructions: In the UI-Msg Field of the Sequence Editor you will see how long the actual run took to execute. Every run makes 500 calls to Session Manager. You will notice that every run takes a little bit longer than the previous. After 100 runs the difference is significant.
    Although my example uses a COM
    port to demonstrate the problem this problem is really related to Session Manager because the same happens if I use an IVI-Instrument (i.e. NI-DMM, NI-Switch, �)
    Any help appreciated!
    Regards
    Herbert
    Herbert Koltschik
    Sagem Communication Austria
    [email protected]
    Attachments:
    sessionmgr_-_slow_down_problem.zip ‏63 KB

    Herbert -
    Thanks for the feedback. I will look into item (1).
    The design of the session manager was to solve the problem of only having to share an instrument within a multithread application. If the session already exists, than you get the same session and thus the same handle, and the instrument is only initialize once and closed after the session no longer exists.
    In the case of a C++ based program you would have to add the session as a member variable that has a specific lifetime. When the object is release, so will the session.
    In the case of an application like TestStand, you just attach the session to the execution. Once the execution goes away, the session may go away if no other execution is using it.
    In the case of L
    abVIEW being called from TestStand, you are using VIs as subroutines, so either the application (TestStand) must manage the lifetime of the session, or the VI subroutine must deligate the lifetime control to a "global" VI. The item you attach to the global could be the refnum itself or the SMgr session. One way of doing this would be to create a VI that serves the refnum to you but internally manages the lifetime of the ActiveX references to the Session Manager sessions. This would be a simple vector of names and their sessions. When called the VI would lookup and return a refnum from an existing session or create a new session and return a refnum for it.
    Scott Richardson
    Scott Richardson
    National Instruments

  • WebService with Session manager and Connection pooling

    I've created many a Oracle users in our RDBMS. It comes to this, that every
    user in our Company has its own oracle account.
    We are developing now a Web application (Internal information system) for my
    Company.
    This Web application will have GUI created in perl and middle tier will be
    Oracle WebServices.
    This WebServices will be connected to the DB for every oracle user and it also
    must have a session management.
    And this is a Action plan:
    1. the user will log to the Web GUI with his oracle login name and a password
    2. this oracle user name and the password will be sent from this Web app to the
    WebService
    3. this WebService will create a connection over a JDBC (not over DataSources)
    and will create also a session (maybe like a servlet)
    4. in this session the instance of the created connection for this user will be
    saved and the WebService will return to the Web app the session id
    5. and this session id will be then used for further calling of WebServices
    Then comes another user, signs up over the Web app with his oracle account and
    this whole process repeats.
    Finally every logged user will have its own session id with his own connection
    instance to DB.
    Maybe it's possible, that it will work only with Servlet (with HttpSession) and
    WebService created from this Servlet.

    Take a look at the Statefull Java Web Services. It may be able to handle your use case.
    http://download-west.oracle.com/docs/cd/B14099_04/web.1012/b14027/javaservices.htm#i1027664
    You should be able to cache the database connection, directly in your service implementation class.
    Hope this helps,
    Eric

Maybe you are looking for

  • Adobe Premiere and After Effects CS6 installer failed to initialize on Mac Book Air

    Hi everybody, I'm trying to install Adobe Premiere and After Effects CS6 for at least a month now. I have downloaded the .dmg file at the Adobe Website and it starts to initializing the installer, then a error show up: "The installer could not initia

  • CLASSPATH and Packages

    Hi i get a i just reorganised my java classes in packages (first time i use packages). After building up the directory tree representind the packages and adding the package statement to the classes i compiled them and everything seems to be find. The

  • Help! Connecting Audigy nx2 to Xmod then to t20 spea

    Hi, the reason i'm connecting this way is Xmod dont have software to tune bass or equalizer. I have the usb adapter and it works fine but i have no free socket. All occupied by T20, laptop, external harddisk and audigy nx2. I'm just wondering if Xmod

  • HD MPEG-2 won't import into dvd SP

    I'm trying to take a 1920x1080 file to dvd, and am usiing HD MPEG-2 from FCP. DVD SP will accept the Dolby audio, but not the video. It seems like a lot of people are having problems playing back HD. Will it be safer to just burn a 720x480 dvd? This

  • Restore original icons?

    I had been using Candybar free preview, didn't want to pay the $30, and now, well after the 2 week preview, I cannot restore my original icons. I've tried "command x".  What am I missing?  I have been pouring thru the FAQ's and I'm fed up.  I *will*