`
soonex
  • 浏览: 2503 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

Enabling session replication in your application

 
阅读更多

To enable clustering of your web application you must it as distributable in the web.xml descriptor. Here's an example:

<?xml version="1.0"?> 
<web-app  xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
                              http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
          version="2.4">
    <distributable/>
    <!-- ... -->
</web-app>

You can futher configure session replication using the replication-config element in the jboss-web.xml file. Here is an example:

<jboss-web>
    <replication-config>
        <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
        <replication-granularity>SESSION</replication-granularity>
    </replication-config>
</jboss-web>

The replication-trigger element determines what triggers a session replication (or when is a session is considered dirty). It has 4 options:

  • SET: With this policy, the session is considered dirty only when an attribute is set in the session. If your application always writes changed value back into the session, this option will be most optimized in term of performance. If an object is retrieved from the session and modified without being written back into the session, the change to that object will not be replicated.

  • SET_AND_GET: With this policy, any attribute that is get or set will be marked as dirty. If an object is retrieved from the session and modified without being written back into the session, the change to that object will be replicated. This option can have significant performance implications.

  • SET_AND_NON_PRIMITIVE_GET: This policy is similar to the SET_AND_GET policy except that only non-primitive get operations are considered dirty. For example, the http session request may retrieve a non-primitive object instance from the attribute and then modify the instance. If we don't specify that non-primitive get is considered dirty, then the modification will not be replication properly. This is the default value.

  • ACCESS: This option causes the session to be marked as dirty whenever it is accessed. Since a the session is accessed during each HTTP request, it will be replicated with each request. The access time stamp in the session instance will be updated as well. Since the time stamp may not be updated in other clustering nodes because of no replication, the session in other nodes may expire before the active node if the HTTP request does not retrieve or modify any session attributes. When this option is set, the session timestamps will be synchronized throughout the cluster nodes. Note that use of this option can have a significant performance impact, so use it with caution.

The replication-granularity element controls the size of the replication units. The supported values are:

  • session: Replication is per session instance. As long as it is considered modified when the snapshot manager is called, the whole session object will be serialized.

  • attribute: Replication is only for the dirty attributes plus some session data, like, lastAccessTime. For session that carries large amount of data, this option can increase replication performance.

If your sessions are generally small, session is the better policy. If your session is larger and some partsare infrequently accessed, attribute replication will be more effective.

分享到:
评论

相关推荐

    Application link enabling

    **应用链接启用 (Application Link Enabling, ALE)** ALE 是 SAP 系统中的一个关键技术,用于在不同组件、模块或系统之间实现数据的实时、自动传输。在本例中,ALE 被用于在一个 SAP 系统内连接两个公司(A 和 B)...

    Agile Application Security Enabling Security in a Continuous Delivery epub

    Agile Application Security Enabling Security in a Continuous Delivery Pipeline 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Agile Application Security Enabling Security in a Continuous Delivery azw3

    Agile Application Security Enabling Security in a Continuous Delivery Pipeline 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Agile Application Security Enabling Security in a Continuous Delivery 无水印pdf

    Agile Application Security Enabling Security in a Continuous Delivery Pipeline 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或...

    servlet调度器的实现实例

    在`webapps/yourapp/WEB-INF/web.xml`中添加以下内容: ```xml ... &lt;servlet-name&gt;myServlet &lt;servlet-class&gt;com.example.MyServlet&lt;/servlet-class&gt; &lt;servlet-name&gt;myServlet &lt;url-pattern&gt;/...

    Enabling ABAP in Eclipse

    【Enabling ABAP in Eclipse】是一项让ABAP开发者能够在Eclipse集成开发环境中进行开发的工作。这一功能的引入为ABAP程序员提供了更为现代化和灵活的开发工具,与传统的SAP Development Workbench相比,Eclipse提供...

    Expert Oracle Application Express(Apress,2ed,2015)

    You'll learn about debugging and performance, deep secrets to customizing your application user interface, how to secure applications from intrusion, and about deploying globally in multiple languages...

    Enabling Interactive Jobs in Virtualized Data Centers

    在虚拟化数据中心中实现交互式任务的关键在于设计与传统批处理任务相协调的调度策略,这一议题由John Paul Walters、Bhagyashree Bantwal 和 Vipin Chaudhary 在他们的研究“Enabling Interactive Jobs in ...

    Pro DLR in .NET 4

    Pro DLR in .NET 4 shows you how to host dynamic languages in your application, enabling users to write scripts to automate tasks. You’ll understand the meta-object protocol and meta-programming ...

    Enabling Green Networking in LEO Satellite Constellations

    在这一背景下,“Enabling Green Networking with a Power Down Approach in LEO Satellite Constellations”这篇文章探讨了如何通过降低LEO卫星星座的能耗,实现绿色网络。 文章首先指出,根据对使用Iridium NEXT...

    Enabling Confidential Computing in Cloud with Intel SGX and Libr

    "Enabling Confidential Computing in Cloud with Intel SGX and Library OSes"这个主题探讨了如何利用Intel Software Guard Extensions (SGX)技术和Library Operating Systems(库操作系统)来提升云环境中的数据...

    Session Border Controllers - Enabling the VoIP Revolution

    会话边界控制器介绍,DataConnect的白皮书。英文版本。

    OpenFlow-Enabling-Innovation-in-Campus-Network以及中文编程资料翻译.docx

    ### OpenFlow:校园网络中的创新推动者 #### 概述 《OpenFlow:在校园网络中推动创新》一文由多位来自顶尖大学的研究员共同撰写,包括斯坦福大学的Nick McKeown、Guru Parulkar,华盛顿大学的Tom Anderson,...

    AVLock.Gold.2002

    Manage through these registration codes up to 254 modules in your application enabling or disabling them or establishing a different authorized period for each one independently of the main ...

    Enabling Application Agility - Software

    一篇关于云计算的资料

Global site tag (gtag.js) - Google Analytics