EJB 3.0 Stateful - Setting session timeout in configuration

Hello Everyone,
I am working with EJB v3.0 and Glassfish as the app server. In case of Stateful EJB, when we explicitely annotate a method with '@Remove', the bean instance is removed from the container when this method is invoked from the client. However, I just wanted to know if there is any way so that I can override the session timeout value (in configuration or via annotations) such that if no client calls this instance for some configured time, the bean is removed by the container automatically.
Regards,
San

Using a Stateful Session facade from a Servlet is not necessarily a bad design. In some cases, you may want to do some cleanup work on completion of a transaction. Stateful Session beans provide a convenient way (By implementing SessionSynchronization interface) to do this.
In the servlet programming model, Servlets are not designed to be single threaded. So if you inject a StatefulSessionBean (SFSB) references then multiple threads could be possibly be invoking the SFSB concurrently. In this case, the EJBContainer (as required by the specification), will throw a well defined exception.
What you may want to do is to place this SFSB reference into you Servlet session.

Similar Messages

  • How to set session timeout per user

    Hi,
    Ho do I set the session timeout per User in the
    Application.cfm File??
    I tried using
    <cfif SESSION.UID EQ 1>
    <CFAPPLICATION NAME="appControl" SESSIONMANAGEMENT="Yes"
    sessiontimeout="#CreateTimeSpan(0,0,20,0)#">
    </cfelse>
    <CFAPPLICATION NAME="appControl" SESSIONMANAGEMENT="Yes"
    sessiontimeout="#CreateTimeSpan(1,0,0,0)#">
    </cfif>
    But this didnt work because the cfapplication seems to have
    to be at the top before I call the variable SESSION.UID which
    I set on my login page..
    Someone know how to do this??
    Regards
    Martin

    Martin,
    Your code example cannot work because the "session" scope
    doesn't exist until your application scope is defined. So you have
    to handle this manually. Here's how you can get it done. First,
    define your application to the maximum sessiontimeout you want to
    have.
    <CFAPPLICATION NAME="appControl" SESSIONMANAGEMENT="Yes"
    SESSIONTIMEOUT="#CreateTimeSpan(1,0,0,0)#">
    Then, I don't know how you are doing your login
    authentication but when you have authenticated the user, you need
    to define the userid and the most recent activity in the session.
    Also determine your timeout value based on the userid. See example:
    <CFIF IS_AUTHENTICATED>
    <CFSET session.user.uid = form.userid>
    <CFSET session.user.most_recent_activity = now()>
    <CFIF session.user.id eq 1>
    <CFSET session.user.timeout_mins = 20>
    <CFELSE>
    <CFSET session.user.timeout_mins = 1440>
    </CFIF>
    </CFIF>
    Now, all you have to do is check whether the user has been
    idle for too long and kill the session by purging all session
    variables. For example:
    <!--- if user id is defined, this means user is logged in
    --->
    <CFIF structKeyExists(session, "user") and
    structKeyExists(session.user, "id")>
    <!--- check if timeout has expired --->
    <CFIF datediff("n", session.user.most_recent_activity,
    now()) gt session.user.timeout_mins>
    <!--- timeout has expired, kill the session and log the
    user out --->
    <CFSET StructClear(session)>
    <!--- insert your logout code here --->
    <CFELSE>
    <!--- user hasn't timed out, so reset the most recent
    activity to now --->
    <CFSET session.user.most_recent_activity = now()>
    </CFIF>
    </CFIF>

  • Setting Session Timeout for HANA Cloud Portal

    Hi all,
    is there any way for setting the session timeout period on HANA cloud Portal?
    If not, what is the predefined session timeout?
    Thank you in advance.
    Silvia Grabmann

    Hi Silvia,
    Session timeout is 20 minutes and cannot be changed. In fact it is configured at the platform level.
    Regards,
    Ifat.

  • Setting session timeout in OracleWeblogic Server

    Hi All,
    I have doubt in setting session time out in Oracle WLS server 12c. Please suggest,
    There are two ways as i know editing the below files.
    1) weblogic.xml
    2) web.xml
    But when I open the weblogic.xml it has the below code, if we edit the value in
    <timeout-secs>3600</timeout-secs>
    the value implied for the admin console only as i know, the admin console will ask the user to re-login if the session is idle for morethan 6 mins.
    But If there is an application deployed like a bank.war file and customer is accessing the application. I want to set the user session time out to 2 mins i.e 120 seconds. How to set this in the server level ?
    Oracle Webogic server level ?
    <session-descriptor>
        <timeout-secs>3600</timeout-secs>
        <invalidation-interval-secs>60</invalidation-interval-secs>
        <cookie-name>ADMINCONSOLESESSION</cookie-name>
        <cookie-max-age-secs>-1</cookie-max-age-secs>
        <url-rewriting-enabled>false</url-rewriting-enabled>
    </session-descriptor>
    In the default web,xml  there is no param called timeout..
    Thanks
    Venkat

    Hello Venkat,
    I have implemented the same in my Application(OBIEE).Check it may helpful for you.
    Sasi Nagireddy: HOW TO CONFIGURE SESSION TIMEOUT IN OBIEE-11G..
    Thanks,
    Sasi Nagireddy..

  • Iplanet 4.1 - How to set session timeout for a specific application

    Hi everyone,
    I have a Iplanet 4.1 old web instance running on Solaris 8. We are using this web instance to connect to few application instances running on Websphere 3.5. We have upgraded most of our web/app to higher version except this.
    One of the websphere applications need more session timeout. (Which I fuguredout not possible to do on Websphere).
    How do I achieve this on Iplanet 4.1.
    NOTE: I referred to Iplanet 6.x where we can achieve this by updating web-app.xml timeOut value per URI. I do not find web-app.xml under v4.1
    Thanks in advance,

    Sorry to say that we can't help here. WS4.1 is obsolete a long time ago.
    As you mentioned that you should use WS6.1SPx or WS7.0 for your production and get support.

  • Setting session timeout in servlet API 2.0 - based JSP (Apache/JServ)

    I'm using Apache/JServ (servlet API 2.0) to run JSPs. At present, a session becomes invalid after 30 minutes of inactivity. How can I increase or decrease this time?
    Thanks.

    You can set by using this command in JSP or servlet
    session.setMaxInactiveInterval(1800);
    replace 1800 (this is in seconds) with the number you want
    Suresh

  • OC4J, Stateful Session EJB, & Session Timeout

    In my J2EE applications, I have a user authentication layer whereby when the user is authenticated against our LDAP repository after logging in, a Stateful Session EJB keeps that conversational state with the client at all times until the user logs out whereby the session is invalidated. This way I keep track of the user's authentication at all times throughout the whole session and for every operation performed (JSPs etc) by the user during the session. All this works fine through my implementation of the Session Facade and Business Delegate patterns.
    However, if OC4J times out the Session (set to one hour in the <session-config> <session-timeout> parameter of the web.xml), the user cannot re-login and proceed. The user has to close the whole browser and re-start a new browser, then login and proceed.
    This is causing us a few problems with the users who are complaining about having to do so. Is there an easy way around this problem?
    Regards
    Daniel

    Can you try in a different browser and see whether you can duplicate this ?
    Is this a problem with browser - cache ?
    regards
    debu

  • Hi I have two questions. I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users? How is the session timeout set? Thanks, YS

     

    <i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
    Um, there is no such thing as NAS4.1.
    I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
    AFAIK, you can specify session timeouts on a per user basis.

  • Session Timeout Setting in Business Intelligence Platform 4

    Greetings.  We are using Business Intelligence Platform 4 SP 2.5.  We use LDAP authentication for logging in to the CMC, BI Launchpad, and Lifecycle Management console.  Our sessions expire after 10 minutes (of either activity or inactivity).  I haven't been able to find the setting that controls the timeout.  Does anyone know?
    Thank you in advance,
    Dave

    Hi Dave,
    TO make the change for the timeout we need to navigate to following location:
    1. Program Files (x86)\SAP BusinessObjects\Tomcat6\webapps\BOE\WEB-INF
    2. Open the web.xml. Search for the "session-timeout" and change the value to as per your requirement.
    3. This change would take effect on both CMC and BI LaunchPad.
    4. Restart the Tomcat.
    At <INSTALLDIR>\Tomcat6\conf\web.xml change 30 to 60:
        <session-config>
            <session-timeout>60</session-timeout>
        </session-config>
    Regards,
    Sonia

  • Portal Session Timeout Setting

    There is a JServ session and a portal session. I know how to control session timeout and session clean up frequency in JServ - that's in zone.properties. But, I dont know how to set timeout for portal session, i.e., I'd like to have the user be forced to login again when he has been idle for 15 mins - and only if he has been idle. Jserv session settings are not sufficient for this because Portal has it's own session that must time out.
    How to set this timeout value (I'm using my own provider which has a timeout setting in zone.properties and includes a bunch of JSP portlets)? Also, is there a clean up thread for which the frequency has to be set?

    I've contacted metalink weeks ago, and this is NOW, a know bug...
    Incredible... Oracle just DO NOT TEST their products... Even a simple SESSION timeout do not work. Also, if I click back after "I log In and Log out" ... Session still up without have to login again!
    BUG 2442268

  • Set a timeout for crystal sessions while using the Windows.Forms.Viewer?

    Hi,
    I am looking for a way to set the timeout for the crystal report sessions when using the Windows.Forms.Viewer in a .NET application. I guess that the default value is 20 minutes (like in the entperprise installations) but we cannot afford to keep many sessions open for that long. Is there a registry entry which can be set? Or even a way to do this programmatically?
    Thank you in advance,
    Stratos

    Hi David,
    we are talking here about a standalone .NET application where the reports are installed locally (like the application itself). We are not retrieving the reports from a server. The whole thing was developed using the crystal report viewer model probably because it was easier to do so. Is there a method in this model to tell the crystal runtime to do the clean-up work either for a report (like the ReportDocument.Close() ) or for the entire runtime instance. Dispose() does not seem to help us. If you say that there is no other way than redesign then we have to consider this option also.
    Cheers
    Stratos
    PS: What I was thinking of (as Plan B instead of using the ReportDocument object model) is to instantiate the crystal report viewer object in a separate process (.exe). Please note that we open a new crystal report viewer windows for each report, which is displayed. Closing the viewer window (ie. terminate the process) will at least then clean up and release the crystal DLLs and hopefully close the database connections. Or am I missing something here?
    Edited by: Efstratios Karaivazoglou on Jul 29, 2008 10:05 PM

  • Weblogic HTTP Sessions timeouts

    Hi All,
    Im quite new to Weblogic 8.1 and am having a problem with HTTP sessions. I have two applications (lets say App1 and App2) in the same Weblogic server, and want to pass information from App1 to App2. Because of HTTP ServletContext rules, I cannot pass session information from one context to another. So instead, when App1 passes information to App2, I create a new session in App2 straight away. When the session timesout, it will redirect me to a page. This redirect will only be done when the user clicks a button (server side redirect rather than a client side automatic redirect). This is all working fine except I hit this problem.
    I have set the timeout interval to 1min (in web.xml) for testing. After I wait 1 min, I click the button and it redirects - Ok thats cool. The real problem is that I wait for the session to timeout after 1 min. Then I wait for an extra 2 mins on top of that (so in theory, the session should still be timed out). When I click the button again, the session is created again rather than redirecting. Now I find this odd. It seems like Weblogic is recreating the session (as I get new session ids).
    Has anyone come across this before and does anyone know how to get around this? Is it some configuration in Weblogic that I need to setup?
    Regards,
    Andy

    <Andy Cheng> wrote in message news:[email protected]..
    Im quite new to Weblogic 8.1 and am having a problem with HTTP sessions. I have two applications (lets say App1 and App2) in thesame Weblogic server, and want to pass information from App1 to App2.
    If your applications exchange data extensively, you may want to consider
    merging them into a single application. If it is not possible, you should follow
    the standard approaches used to connect standalone, remotely located
    applications. The range of possible design solutions is pretty wide - web
    services, EJB, CORBA, etc.
    Regards,
    Slava Imeshev

  • How to Sync the session timeout of Portal with CMS Server

    Hi Experts,
    We have a custom application build on our portal which will launch the reports of InfoView. It works fine untill the portal session timeout. Whenever the session timeout occurs and reloads it I am unable to launch the reports and getting the below exception.
    com.crystaldecisions.sdk.exception.SDKException$OCAFramework: Unable to reconnect to the CMS server_ip:6400. The session has been logged off or has expired. (FWM 01002)
    Portal is configured with SSO. Please adviese how to set the settings of session timeout in such way that Portal sync  session timeout with CMS server.
    Thanks in Advance,
    Chinaa.

    Hi ,
    There is no such option to sync Portal timout with CMS server.
    To resolve your problem you have only option to set your CMS server timout to MAX value.
    Thanks
    Anil

  • OAM Session timeout

    Hi All,
    I have the following set up configured.
    1)Deployed a web application in a plain(non oim suite related) weblogic domain
    2)Installed OHS,OAM,OIM and OUD
    3)Configured OHS,OAM,OIM and OUD for SSO in OAM with the external URL from the independent weblogic domain
    4)Independent Weblogic domain is configured with OAMIdentityAsserter and OUD Authentication provider
    My query is as below.
    I have the session time out value configured as 600(seconds) in weblogic.xml of the web application.
    Now when the access the web application through OHS SSO URL, the session is not waiting for 600 seconds to timeout,but getting invalidated in around 30 seconds.
    How to resolve this issue.
    Please advice.
    I have the following configured in OHS proxy.
    <Location /bc>
    SetHandler weblogic-handler
    WebLogicHost ZZZZZZ.oracle.com
    WebLogicPort 9001
    </Location>
    firebug show the following URL getting hit just after the session invalidation http://ZZZZZ.com/oam/server/obrareq.cgi?encquery%3DHBGRZNUhr5Ucxs
    and the following error gets logged in oam server
    "Session invalid as returned by CHECK_VALID_SESSION_RESPONSE responseEvent fail>"
    Kindly suggest.
    Thanks,
    Praveen

    Verify whats session timeout value present in below config:
    http://docs.oracle.com/cd/E27559_01/admin.1112/e27239/session.htm#AIAAG354
    To edit the OAM common session settings:
    Log in to Oracle Access Manager.
    Click System Configuration.
    From the Common Configuration panel, double-click Common Settings.
    In the Session area:
    In Session Lifetime, increase the current value.
    In IdleTimeout (minutes), increase the current value.
    Click Apply.
    ~J

  • Portal Session Timeout - ICM/Webdynpro/POWL

    Hi Experts,
    We are having SRM Portal which has POWL Webdynpro and other applications running.
    SRM Portal is a seperate JAVA Instance and integrated to backend with SSO enabled.
    We have Logon Ticket Timeout set as default 8 Hours and the Session Timeout in Portal set as 2 Hours (Server>services>webcontainer>properties>Session Timeout).
    For the ABAP backend, we have rdisp/plugin_auto_logout-->7200 (2 Hours) and ICM timeout as remommeded by SAP as icm/server_port_0     = PROT=HTTP,PORT=8012,TIMEOUT=90,PROCTIMEOUT=600
    Now the problem is:
    1. Users connected to portal and work on any POWL Iviews has an idle time of two hours-->we get the ICM session timeout error page.
    2. Sometimes Users get the Login screen of portal within the Navigation Frame which can be identified as the Ticket Expiration
    Is there a possibility to control the behavior of portal to avoid these error pages to Users like if the timeout happened in backend, there should be auto refresh if the user clicks the application.
    And if the ticket expired, the portal should refresh to the home screen on clicking any Iview.
    We tried the IDLE timeout pop up and in Vain, you could see my another post on the same.
    Portal Idle Pop Up
    Regards,
    Sethu

    Hi,
    Read SAP note 705013,
    I think adjusting the kernel parameters, rdisp/gui_auto_logout and  rdisp/plugin_auto_logout will help.
    Try adding below parameters in the Instance profile.
    icm/keep_alive_timeout 3600
    icm/conn_timeout 5000
    Regards,
    Venkata S Pagolu

Maybe you are looking for