Session Sharing on Different Servers

Is it possible to access the data of a session created in one server
          instance from a different server instance, without necessarily
          clustering? And if so - how?
          For example:
          User has a session created and some data stored on session of
          server1.domain.com.
          User then goes to server2.domain.com and accesses data of session
          created on server1.domain.com.
          TJS
          

hi!
you look them up, just the same way as at the same container. you just have to specify the location of the JNDI, where the beans should be looked up (environment settings).
Hashtable env = new Hashtable();
// com.evermind.server.rmi.RMIInitialContextFactory IS IMPORTANT
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin"); // user
env.put(Context.SECURITY_CREDENTIALS, "admin"); // pwd
env.put(Context.PROVIDER_URL, "ormi://OC4J2/BeanAppl"); //location + applname
Context context = new InitialContext(env);
SBHome sbHome = (SBHome)PortableRemoteObject.narrow(context.lookup("SB"), SB.class);
SB sb = SBHome.create();
hope 2 help you ;o)
ed

Similar Messages

  • Session sharing among different web application under Oracle AS

    Hi,
    I'm looking for some information on web application session information sharing under Oracle AS10.1.3.
    any pointers are highly appreciated.
    Thanks,
    Narasimha.

    Hello,
    I see that you have duplicate your post in different forums, Session sharing among different web application under Oracle AS10.1.3.
    Regards
    Tugdual Grall

  • Http session distributed on different servers?

    Hello.
    I have several webapps, running on different servers (I mean hardware servers). Say, several tomcats each runnig a webapp. Say, one of these servers is the main server and others are performing some auxillary web actions. I'd like that a client would authenticate on the main server and then her session will become valid for other non-main servers. What are the standard mechanisms for distributing an http-session? Can I have some ready solution because I do not want to invent it myself..
    Thank you, any advice is appreciated!

    As i know, Any client can't access a session of other client.
    The client of ServerA's session is a first browser.
    "A new browser window" is a new client on ServerB.
    That mean first browser and second new browser are different clients for weblogic.
    So new browser can't access first browser's session on ServerA.
    This is not issue of cluster or browser.

  • SFSB Instance Sharing across multiple servers/SFSB failover practices

    Hello:
    My question is in two parts. I have spent a great deal of time searching the forums without a satisfactory answer, so I thought I'd post my question directly.
    1) I have two clients that can potentially talk to two different servers, but they both need to interact with the same instance of a SFSB. For example, the first client calls the SFSB and causes it to save some state in its instance variables. The second client connects to a different server (because of a "network dispatcher" load-balancing architecture), but needs to use the same instance of the SFSB that the first client initialized. The two clients will not always talk to different servers, but the possibility exists that they might.
    2) What is the proper design pattern for "fail-over" for a SFSB. For example, a client establishes a session, tickles a SFSB and causes its instance variables to contain state, and then WHAMO the application server crashes or becomes unavailable for some reason. We have in place a mechanism to reroute further client request to a second application server, but currently it is a problem because even though the failover is transparent to the client, the backup server creates a new instance of the SFSB and therefore it has none of the previous state information.
    I'm thinking that the answer to one of these questions will be the answer to the other.
    A little bit of background: this is not a theoretical application. We are building 250+ cars per day, ramping up quickly to 500-650 cars per day. I'm hoping I can solve this problem from an architectural standpoint, without having to modify each individual bean, because we have on the order of 200-300 SFSBs that would have to be changed--not a pretty thing in a production critical application. We have two AIX servers, but one of them is currenlty just a hot standby because we cannot run both of them at the same time because of problem 1) from above. We'd like to be able to run both servers at the same time for load-balancing purposes. Furthermore, if one box fails then all SFSB data will be lost because of the problem is mentioned problem 2) above.
    (As a point of clarification, and only because I don't know if this affects any possible suggestions, but the clients do not use remote references to the EJBs. They simply pass "data containers" via HTTP to the server, and this data is passed to the various EJBs and returned back to the client via HTTP Response and in some cases TCP/IP. In either case, we do not use "remote object" references in the most typical sense. The servlet maintains the references to the EJBs.)
    I've read things about "session clustering" but have not pinned down the subject. I have the "Core J2EE Patterns" book on order.
    Any suggestions or pointers to reading materials would be greatly, greatly appreciated. I also welcome the "what you should have done" variety suggestions.
    Thanks!
    Regards,
    Doug Wilkerson

    Doug,
    Here are my thoughts, I hope they help.
    I don't think there is a possibility to have two different client (different sessions) talk to one and the same SFSB. A SFSB is specific to a users session and cannot be shared.
    The way I would tackle this problem is probably by using SLSB which might access either an entity bean or the DB directly. This way, you might cause DB overhead, but you can share the data between clustered servers and the users will work with the correct data.
    About the second question, I don't really now a pattern to provide fail-over for SFSB. To my opinion that is the weakest side of SFSB (beside all the load-balancing that needs to take place).
    Hope this helps.

  • Getting attributes from session between two different applications

    I'm developing with JDK 1.3 and deploying my webapp at ORACLE 9iAS.
    I would like to jump between JSPs deployed at differents OC4J instances and
    keep session object. I've seen I can get sessionID and it's the same but the attributes have disapeared.
    I jump using JavaScript code (document.location.href).
    Should I use a <form> ?
    Should I use getServletContext() method ?
    I dont know even if it's possible and I don't want to loose my time looking for a solution that doesn't exist.
    NEED HELP, AN EXAMPLE OR WHATEVER USEFUL.
    ... THE SOON AS POSSIBLE
    THANX in advance
    PS..- I have already look for in this forum but I didn't get any info to solve my doubts. If I mistaken please let me know

    Ok.
    getServletContext().getContext() may return null in 'security conscious' servers. Apparently this is your case, therefore you wouldn't be able to use it to store global data...
    As for sharing sessions directly between different web apps, the servlet spec (since 2.2 at least) explicitely prohibits it.
    The link provided by tolmank about pseudo-sessions should address your issue, since it will allow you to distribute your session data on your different webapps.
    Some other alternatives would be :
    -store the session data in the DB (slow)
    -use java serialization
    -use RMI
    -use JNDI
    -if you're using Tomcat, you can implement single-signon accross multiple apps using cookies :
    http://www.ingrid.org/jajakarta/tomcat/tomcat-4.0b5/src/catalina/docs/singlesignon.html

  • What are the entities that can be re-used in different servers, SI App, SI instance? And how?

    Greetings,
    What are the entities that can be re-used in different servers, SI App, SI instance? And how?
    e.g. can I use a deployed IQStreamable@app1  into app2?
    can I use a deployed observable/app1/siInstance1/Server1 into another query/app3/siInstance3/server2?
    On the presentation titled "04 – Installing, Deploying and Maintaining the SQL Server 2008 R2 StreamInsight Runtime Engine" with file name SQL10R2UPD05-DECK-04.pptx on ecn.channel9.msdn.com/o9/learn/SQL2008R2TrainingKit/Presentations/SQL10R2UPD05-DECK-04/SQL10R2UPD05-DECK-04.pptx
    It is mentioned one of the deployment option is "Deployment: Standalone Server"
    and it mention the following:
    "Use this option for the following scenarios:
    - Metadata objects need to be shared between applications
      - Event Types
      - Adapter Types
      - Query Templates
    - A data source registered with the server provides an event stream for another existing application"
    Could you please provide good example that explain the above statement?
    Cheers, Muhammad

    First, that statement - and those materials - refer to the "legacy" StreamInsight query/adapter model. They do not refer to how things work with the Reactive model introduced in version 2.1. Specifically, it talks about Dynamic Query Composition (DQC).
    You cannot use a deployed Observable in another instance of StreamInsight. You may be able to use them across applications in the same instance - off the top of my head, I'm not sure. I'm getting ready to get on a plane but will take a look at it later.
    Typically, however, applications act as containers (comparable to .NET AppDomains) so I don't think that you'd be able to do this easily. That said, the code and assemblies
    can be reused across multiple instances/applications. You would have separate instances of the classes involved but you would be able to reuse the query logic. That's a common use case.
    Can you be more specific about your use case and what you are trying to accomplish here? It's possible that there are alternative ways to do what you are trying to do.
    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)
    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • CFLOGIN works, but not simultaneously on different servers/broswers

    I'm using CFLOGIN with application.cfc which works great when I test it - I'll call it login session A in browser window 1.
    When I simultaneously log into the same app on a different server with a different username (login session B in browser window 2), I can't login - unless I log out out of session A/browser window 1 first. Something in my new code is preventing me from logging into my app more than one time, even when the apps are on separate servers and I'm using different usernames.
    We have the same app on various servers (test/development/production), and I used to be able to login on 2-3 browsers or servers at a time - and I never had a problem until recently when I made some changes to the application.cfc and login code.
    I updated the code because before the session scopes and login credentials were not being initiated and terminated together (upon login/logout). Before, a user was clicking 'logout' and it was clearing the session scopes without invoking CFLOGOUT. Now, I fixed that, but I have another problem, which is that I can't log into the application on two different browsers or servers at the same time (even if I'm using different login usernames). Any suggestions would be appreciated.
    <cfcomponent displayname="Application" output="false">
        <cfset this.name = 'SampleApp'>
        <cfset this.SessionManagement = true>
        <cfset this.SetClientCookies = true>
        <cfset this.SessionTimeout = CreateTimeSpan( 0, 0, 5, 0 ) />
    <cffunction name="onSessionStart" access="public" returntype="void" output="false">
        <cfset session.hostname = 'http://'&#CGI.HTTP_HOST#&'/'>
        <cfset session.dbase = 'localdb'>
        <cfset session.roles = ArrayNew(1)>
        <cfreturn>
    </cffunction>
    <cffunction name="onApplicationStart" access="public" returntype="boolean" output="false">
        <cflog file="SampleApp" type="information" text="Application started." />
        <cfreturn true>
    </cffunction>
    <cffunction name="onApplicationEnd" returntype="void" output="false" hint="Executes on session timeout or if server shuts down.">
        <cfcookie name="CFID" value="#CFID#" expires="now">
        <cfcookie name="CFTOKEN" value="#CFTOKEN#"  expires="now">
        <cfreturn>
    </cffunction>
    <cffunction name="onRequestStart" access="public" returntype="void" output="true" hint="Executes before each page processes.">
        <cfargument name="targetPage" type="String" required="true"/>
            <cfsilent>
            <cfif GetAuthUser() NEQ ''>
                <cfif NOT isDefined('session.uname')>
                    <cfif CGI.HTTP_REFERER DOES NOT CONTAIN "login.cfm">
                        <cfinclude template="expired.cfm">
                        <cfabort>
                    </cfif>
                </cfif>
            </cfif>
            <cflogin>  
                <!--- Flash Remoting setCredentials() passes cflogin.user and cflogin.password using checklogin.cfc --->
                <cfif IsDefined('cflogin')>        
                    <cfquery name="qValidateLogin" datasource="#session.dbase#" username="#cflogin.name#" password="#cflogin.password#">
                        SELECT    role
                        FROM    session_roles
                    </cfquery>
                    <cfif qValidateLogin.RecordCount GT 0>
                        <cfloginuser name="#cflogin.name#" password="#cflogin.password#" roles="#qValidateLogin.ROLE#">
                        <cflog text="User - #cflogin.name#" type="Information" file="Filename" date="yes" time="yes">
                    <cfelse>
                        <cfinclude template="login.cfm">
                        <cfabort>
                    </cfif>
                <cfelse>
                    <cfif right(arguments.targetPage,10) is "logout.cfm">
                        <cflocation url="index.cfm">
                        <cfabort>
                    <cfelse>              
                        <cfinclude template="login.cfm">
                        <cfabort>  
                    </cfif>          
                </cfif>
            </cflogin>
            </cfsilent>      
    </cffunction>
    </cfcomponent>

    Oh no, that was my mistake. Thank you for catching that! That query is currently not being used on my Application.cfc page, which is why I wasn't having problems with it, but I'm glad you pointed it out to me. I had that code in my Application.cfc file just incase I wanted to check login from somewhere else, but my login query is actually being called with Flash Remoting using setCredentials() to connect to login.cfc. This is the correct query in my login.cfc file:
                <cfquery name="qValidateLogin" username="#session.uname#" password="#session.pword#" datasource="#session.dbase#">
                    select role from session_roles where role like 'xxxxx%'     
                </cfquery>
    I do think I figured out a solution to my problem though. I found out how to use applicationToken, which I understand if it is not set, by default will be the value of application.Name. If you want users to be able to log into multiple instances of  your application at the same time, you would give the applicationToken the same value. This would be great for clustered servers or sites with sub-domains.
    If you wanted to force only one login for the three different sites, you could give this a different value. VERY useful. So I have:
    <cfcomponent displayname="Application" output="false">
        <cfset this.name = 'SampleApp'>
        <cfset this.SessionManagement = true>
        <cfset this.SetClientCookies = true>
        <cfset this.SessionTimeout = CreateTimeSpan( 0, 0, 5, 0 ) />
        <cfset this.loginStorgage = "session">
        <cfset this.applicationtoken = 'SampleAppSub'>
    Now, I can log into this site on my development machine with multiple browsers pointing to the same site hosted on different servers - with no problem. I never had an issue with this before, but something else I recently added into my code in Application.cfc made this not work. I should probably also mention that I work on many different applications that all use the same application.Name even though they are different sites - we do this so the same settings can be deployed on different servers.
    With the applicationToken settings, I have it working again. Perhaps what made it break was setting this.loginStorage = "session"? Before this was not set and was using the default value of  "cookies" which I didn't want - because my site is used by different people on the same box and we have clustered servers.

  • Load balancing and session sharing

    Hi,
    in my company we have the following situation:
    We have 2 instances of the same web application on differend servers.
    An external load balancer (Alteon) routes the requests to these instances.
    The problem:
    If one instance is shutting down, all the sessions of this app are gone. These users has to login again.
    The question:
    Is it possible to avoid this?
    Is is possible to keep these session, so the users don't have to login again?
    Maybe with a kind of session sharing between these 2 instances?
    using:
    oc4j standalone - 10.1.3.1
    OS: Windows
    thank you
    Marcus

    The solution:
    Multicast IP replication is the default replication protocol used in a standalone OC4J installation
    see: http://download.oracle.com/docs/cd/B32110_01/web.1013/b28950/cluster.htm#BABBHGHJ
    -> Configuring Multicast Replication

  • Golden gate extract from multiple oracle db's on different servers

    Hello,
    I am new to golden gate and I want to know if is it possible to extract data from an oracle database which is on a different server? Below is the server list
    Linux server 1: has oracle database (11.2.0.4) (a1db) and golden gate installed (11.2.1.0.3).
    Linux server 2: has oracle database (11.2.0.4) (b1db)
    a1db and b1db are not clustered, these are 2 separate instances on 2 different servers.
    Is it possible to capture change data on b1db from GG installed linux server 1? I am planning to use classic capture.
    architecture like below, can it be done? If so what option I will be using in the extract
    Thanks,
    Arun

    Here is something from my personal notes; hope this helps:
    Standby or Off Host Environment
    GoldenGate extracts, data pumps and replicats can all work with database environments accessed using TNS.  When one of these processes needs to work with a database environment over TNS then instead of the following USERID specification:
    setenv (ORACLE_SID = “GGDB")
    USERID ggsuser, PASSWORD encrypted_password_cipher_text
    The following USERID specification would be used:
    USERID ggsuser@GGDB, PASSWORD encrypted_password_cipher_text
    When this specification is used the setenv line is not required since the process will connect over TNS.
    When a data pump or replicat is running in a standby or otherwise an off host environment the USERID specification above is the only special requirement.  It is recommended that the TNS entry contains the necessary failover and service name configuration so that if or when switch over or fail over occurs, the process may continue once the environment is available again.  if the data pump is using the PASSTHRU parameter then a USERID specification is not required.  When the data pump is operating in PASSTHRU mode, it does not need a database connection to evaluate the metadata.
    When a source extract is running in a standby or otherwise off host environment the USERID specification above is required as well as Archive Log Only mode.  It is recommended that the TNS entry contains the necessary failover and service name configuration so that if or when switch over or fail over occurs, the process may continue once the environment is available again.  The source extract requires a database connection in order to evaluate the metadata that occurs in the archived redo log.  Since the source extract is running in an environment separate from the source database environment it is unable to read the online redo logs.  Therefore it is required to be configured in Archive Log Only mode.  If the environment that the source extract is running in is a standby environment, then it will evaluate the archived redo logs through switchover. 
    The standby or off host environment has minimal requirements. The requirements that need to be met are Oracle software availability and storage for archived redo logs.  If the database environment where GoldenGate will be running is a standby database environment then GoldenGate can utilize the required shared libraries from the standby database environment.  However if GoldenGate is being executed from a server environment does not contain a database environment, a client installation is required at a minimum.  This will provide GoldenGate with the necessary shared libraries in order to satisfy it’s dynamically linked library dependencies.  The archived redo logs must also be available for GoldenGate to read.    They can be made available using a shared storage solution or with a dedicated storage solution.  A standby database environment works well for this purpose as it is receiving archived redo logs on a regular basis.  GoldenGate is able to leverage these archived redo logs and not impose any additional infrastructure requirements in order to evaluate and capture the data changes from the source database.  In order for GoldenGate to be utilized with a standby database environment for archived redo log access, only a minimal standby database is required.  Specifically the standby database needs to be be mountable so that it can accept archived redo logs.  Since GoldenGate will connect to the primary database to evaluate the metadata contained in the archived redo logs, a complete standby database is not required.

  • RD Gateway and RD Web Access - better together or on different servers?

    I am evaluating Remote Desktop Services with 2012 R2 and initially I had all the roles on 1 server for testing.  I began thinking it would be a better setup to split the RD Gateway role and the RD Webaccess role into different servers for security purposes.
     This way I could expose only the RD Gateway to the internet and the Web Access role would not be exposed.  In all my reading and searching it seems that nearly every article I come upon has both RD Gateway and Web Access installed on the same system.
    What is the ideal setup from a security standpoint to have the these two roles separate or does it not mater?  If it does not mater then I will setup 1 server with Gateway and Web Access and I will then have other servers for licensing, broker, session
    host, and visualization host once I move this into production.
    If these roles are on the same system how do I know if the gateway role is doing anything?  Is the FQDN\rdweb the correct URL to use even when the gateway is implemented?  
    If they are separate how do I tell the gateway and web access servers to use each other?  

    Hi,
    As far as I know, it’s fine to have RD Gateway and RD Web Access roles installed on the same server.
     “Normally external users would log on to RD Web Access via tcp port 443, click on a RemoteApp and connect to RD Gateway via
    tcp 443/udp 3391, RDG connects them to RDCB on tcp 3389 which redirects them to a RDSH server, finally the RDG connects to the RDSH on tcp 3389/udp 3389.”
    Quoted from TP in this post below:
    RD Gateway and RD web issue
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/5ab40559-23f7-4ebc-b60d-87375cc55674/rd-gateway-and-rd-web-issue?forum=winserverTS
    More links below for you:
    RD Gateway deployment in a perimeter network & Firewall rules
    http://blogs.msdn.com/b/rds/archive/2009/07/31/rd-gateway-deployment-in-a-perimeter-network-firewall-rules.aspx
    Remote Desktop Gateway/Web Server Placement
    https://social.technet.microsoft.com/forums/windowsserver/en-US/b2970cf5-a5b5-494c-88b7-cd6e01f84bb6/remote-desktop-gatewayweb-server-placement
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

  • How to prevent session sharing ???

    I am getting a problem when i access my application with different logins from same machine ( same browsers ) ,
    then old login session is updating with new login session,
    how can i prevent this session sharing?
    thanks in advance

    What's probably happening is that you use file cookies (cookies are stored in your file system).
    1. You log in from browser 1 as User A. The server sets a session cookie on your file system.
    2. You continue to work from browser 1. The session cookie gets sent in every request and all is fine.
    3. Now you open another browser and log in as User B. The server sets a session cookie identifying you as User B on your file system.
    4. This overwrites the cookie that was set earlier that identified you as User A The concept is that you can have only one cookie from a server for a specific purpose (session identification in this case)
    5. When you go back to browser 1 now and access the site, the second cookie gets sent (the one that identifies you as User B) and you are logged in as User B now.
    ram.

  • Session sharing again

    Hi all,
    A problem with a slight difference from the one just posted by vakkanti about http-session sharing.
    In our servlet/JSP application the users can of course open a new window within their browser.
    The problem is that both windows are now using the same HTTP-session because the other session has not yet been invalidated and that gives problems in the use of session variables etc.. How can I force that the the new window is using a new session? Or otherwise at least deal elegantly with this problem. It must be a well known problem I think.
    Regards,
    Ronald

    Hello Ronald,
    I do not thinnk that is a 'J2EE issue' in the sense this is the way browser reacts. When you open a new window you are in the same context in term of cookie, session, etc etc. All container will react the same way with a new opened window.
    The only way that I now to have multiple windows and different sessions is:
    - on Internet Explorer and with creatin a new process by running IE (Clicking or run command) not with the File>New window , or any links.
    Could you explain why you need multiple session in different window? What is the businness requirement of your application? (we may be able to find a work around, since the behavior your expect is not supported by browsers)
    Regards
    Tugdual Grall

  • Session sharing among multiple WAR files inside an EAR file

    Hi all,
    Is there a way where I can share my session object among multiple WAR files which are inside an EAR file?
    Please suggest.

    r035198x wrote:
    Some application servers (like Weblogic) allow to configure session sharing when you deploy the application.Sidenote: which is completely against the servlet spec.

  • Does Session Sharing feature provided by SAP Net Weaver application server

    Hi All,
    Session Sharing is an additional feature provided by Tomcat , Weblogic  and Web sphere application servers.
    Is this feature available in  SAP Net Weaver application server?
    Brief description on Session Sharing
    Session Sharing  specifies whether HTTP sessions are shared across multiple Web applications.
    In Weblogic this is an optional feature customizable in weblolgic-application.xml
    Sample weblogic-application.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session-descriptor>
          <persistent-store-type>replicated_if_clustered</persistent-store-type>
          <sharing-enabled>true</sharing-enabled>
    </session-descriptor>
    </weblogic-application>
    session-descriptor (Optional Element ) - Specifies a list of configuration parameters for servlet sessions.
    sharing-enabled (Optional Element ) - Specifies whether HTTP sessions are shared across multiple Web applications. Default value is false.
    Thanks in advance.
    Regard's
    Srikanth
    Edited by: Srikanth A on May 14, 2010 7:36 PM

    Hi,
    You cannot set up Garbage collection frequency. it is internally handled by Java when the Heap size is filled up.
    You can always fine tune your server to SAP recommendations.
    Note 723909 is a good starting point.
    Also other checks include that you use SAP recommended Java versions, OS patches and also that you have enough physical memory.
    Thanks & Regards,
    Vijith

  • HTTP session sharing

    Hi,
    We have a need for session sharing among the different JVMs and have been trying the application cluster functionality with zero luck. Now we are thinking of looking into coherence because by reading the documentation we came to know this is something we could accomplish it. Since being a very new on this, have anyone done this and if you have can we get some information on how to do it. We will really appreciate your help on this.
    Thanks,
    Raj

    To better understand the background of your root problem,
    1) which Application Server product are you using?
    2) the term "clustering" may mean different things to different App Server implementations. Does your reference to clustering also mean "Http Session Replication" has been specifically enabled, or that by simply clustering JVMs you expect this to happen automatically?
    3) is access to the session needed by the same web app or different web apps in the JVMs?

Maybe you are looking for