Thursday, April 9, 2009

WebLogic In-Memory HTTP Replication for Oracle ADF Applications

In my previous post - WebLogic Load Balancing for Oracle ADF Applications, I have described how to setup cluster environment with a set of WebLogic Managed Servers together with separate WebLogic domain for Load-Balancing. Today I will describe, how to enable In-Memory replication in cluster environment.

Load-Balancing allows to distribute user sessions across cluster elements, based on current server load. However, if one of Managed Servers from cluster will go down, all the sessions on this server will be destroyed and users will loose their work. In order to avoid this, WebLogic server allows to enable replication between Managed Servers in cluster. In this blog I'm describing In-Memory HTTP replication.

You can enable session replication, basically by adding one parameter into weblogic.xml file. You should edit weblogic.xml available in your Oracle ADF application, if you don't have this file - create it in WEB-INF folder:


Specify PersistentStoreType parameter and set replicated as value:


All required configuration is done, now you can deploy application on WebLogic cluster. Here I'm accessing ADF Faces Rich Client page through Load-Balancing domain:


Load-Balancing domain have redirected to a second Managed Server, I have pressed Save button on application page couple of times, you can see it from the server log:


I have killed second Managed Server:


I didn't closed my browser and have pressed Save button again - without replication I would get server error, however now my session is successfully transferred to the next available Managed Server from cluster environment - its third server:


You can see from the log - Save operation was successfully done. User didn't lost his session and can continue work:


Spanish Summary:

En post anteriores, Andrejus nos había mostrado como configurar nuestras aplicaciones hechas con ADF para poder soportar el balanceo de carga en los servidores WEB Logic. En esta oportunidad, se muestra como mejorar esta configuración y permitir el aseguramiento de las sesiones de las aplicaciones (en balanceo de carga) ante una caida en uno de los servidores.

5 comments:

  1. Hi Andrejus,

    I tried something similar in new WLS 11g (although I think the behavior was the same in 10.3), and ran into a problem with keeping modified data (in train, in my case) after WLS failure.... I have posted the details on the JDeveloper forum, I would appriciate if you would find the time to take a look at it and share your oppinion.

    http://forums.oracle.com/forums/thread.jspa?threadID=928010&tstart=0

    Thanks,
    Pedja

    ReplyDelete
  2. With latest WebLogic we should use REPLICATED_IF_CLUSTERED (configured in weblogic.xml) for persistence store and adf-scope-ha-support = true (configured in adf-config.xml).

    For more info referer to http://download.oracle.com/docs/cd/E17904_01/core.1111/e10106/adf.htm#CACHEIBG (look for Oracle ADF Replication)

    Andrejus

    ReplyDelete
  3. Hi Andrejus,

    We are starting a weblogic 11g clustering POC. We are using eclipse Helios to develop a simple POC web application. If we want to replicate http replication in memory, I am just wondering if we need to create a weblogic.xml and put REPLICATED_IF_CLUSTERED in the file.

    Thanks

    JIn

    ReplyDelete
  4. Yes, you need weblogic.xml, you can create it manually inside WEB-INF folder.

    Andrejus

    ReplyDelete
  5. Hi Andrejus,

    With ADF Security configured in an appliction, user is redirected to login page but with error "Error 404 - Not Found".

    Same appilcation works fine when deployed on non-clustered managed server or when user bypass proxy and go directly to application on a managed server in a cluster.

    Any help would be appreciated.

    ReplyDelete