[jboss-cvs] JBossAS SVN: r74321 - projects/docs/enterprise/4.3/Transactions/Transactions_Failure_Recovery_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 9 18:13:07 EDT 2008


Author: irooskov at redhat.com
Date: 2008-06-09 18:13:07 -0400 (Mon, 09 Jun 2008)
New Revision: 74321

Modified:
   projects/docs/enterprise/4.3/Transactions/Transactions_Failure_Recovery_Guide/en-US/How_JBossTS_managers_the_OTS_Recovery_Protocol.xml
Log:
Failure Recovery Guide docbook xml conversion is complete


Modified: projects/docs/enterprise/4.3/Transactions/Transactions_Failure_Recovery_Guide/en-US/How_JBossTS_managers_the_OTS_Recovery_Protocol.xml
===================================================================
--- projects/docs/enterprise/4.3/Transactions/Transactions_Failure_Recovery_Guide/en-US/How_JBossTS_managers_the_OTS_Recovery_Protocol.xml	2008-06-09 21:35:38 UTC (rev 74320)
+++ projects/docs/enterprise/4.3/Transactions/Transactions_Failure_Recovery_Guide/en-US/How_JBossTS_managers_the_OTS_Recovery_Protocol.xml	2008-06-09 22:13:07 UTC (rev 74321)
@@ -2,24 +2,345 @@
 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
 ]>
 
-<chapter id="chap-Transactions_Failure_Recovery_Guide-Test">
-	<title>Test</title>
+<chapter id="chap-Transactions_Failure_Recovery_Guide-How_JBossTS_manages_the_OTS_Recovery_Protocol">
+	<title>How JBossTS manages the OTS Recovery Protocol</title>
 	<para>
-		This is a test paragraph
 	</para>
-	<section id="sect-Transactions_Failure_Recovery_Guide-Test-Section_1_Test">
-		<title>Section 1 Test</title>
+	<section id="sect-Transactions_Failure_Recovery_Guide-How_JBossTS_manages_the_OTS_Recovery_Protocol-Recovery_Protocol_in_OTS-Overview">
+		<title>Recovery Protocol in OTS-Overview</title>
 		<para>
-			Test of a section
+			To manage recovery in case of failure, the OTS specification has defined a recovery protocol. Transaction’s participants in a doubt status could use the RecoveryCoordinator to determine the status of the transaction. According to that transaction status, those participants can take appropriate decision either by roll backing or committing.
 		</para>
+		<para>
+			A reference to a RecoveryCoordinator is returned as a result of successfully calling register_resource on the transaction Coordinator. This object, which is implicitly associated with a single Resource, can be used to drive the Resource through recovery procedures in the event of a failure occurring during the transaction.
+		</para>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/RecoveryCoordinator.png" format="PNG"/>
+			</imageobject>
+			<caption>Resource and RecoveryCoordinator relationship.</caption>
+		</mediaobject>
 	</section>
 	
-	<section id="sect-Transactions_Failure_Recovery_Guide-Test-Section_2_Test">
-		<title>Section 2 Test</title>
+	<section id="sect-Transactions_Failure_Recovery_Guide-How_JBossTS_manages_the_OTS_Recovery_Protocol-RecoveryCoordinator_in_JBossTS">
+		<title>RecoveryCoordinator in JBossTS</title>
 		<para>
-			Test of a section
+			On each resource registration a RecoveryCoordinator Object is expected to be created and returned to the application that invoked the register_resource operation. Behind each CORBA object there should be an object implementation or Servant object, in POA terms, which performs operations made on a RecoveryCoordinator object. Rather than to create a RecoveryCoordinator object with its associated servant on each register_resource, JBossTS enhances performance by avoiding the creation of servants but it relies on a default RecoveryCoordinator object with it’s associated default servant to manage all replay_completion invocations. 
 		</para>
+		<para>
+			In the next sections we first give an overview of the Portable Object Adapter architecture, then we describe how this architecture is used to provide RecoveryCoordinator creation with optimization as explained above. 
+		</para>
+		<formalpara>
+			<title>Understanding POA</title>
+			<para>
+				Basically, the Portable Object Adapter, or POA is an object that intercepts a client request and identifies the object that satisfies the client request. The Object is then invoked and the response is returned to the client. 
+			</para>
+		</formalpara>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/POA.png" format="PNG"/>
+			</imageobject>
+			<caption>Overview of the POA.</caption>
+		</mediaobject>
+		<para>
+			The object that performs the client request is referred as a servant, which provides the implementation of the CORBA object requested by the client. A servant provides the implementation for one or more CORBA object references. To retreive a servant, each POA maintains an Active Object Map that maps all objects that have been activated in the POA to a servant. For each incoming request, the POA looks up the object reference in the Active Object Map and tries to find the responsible servant. If none is found, the request is either delegated to a default servant, or a servant manager is invoked to activate or locate an appropriate servant.  In addition to the name space for the objects, which are identified by Object Ids, a POA also provides a name space for POAs. A POA is created as a child of an existing POA, which forms a hierarchy starting with the root POA.
+		</para>
+		<para>
+			Each POA has a set of policies that define its characteristics. When creating a new POA, the default set of policies can be used or different values can be assigned that suit the application requirements. The POA specification defines:
+		</para>
+		<itemizedlist>
+			<listitem>
+				<para>
+					<emphasis>Thread policy:</emphasis> Specifies the threading model to be used by the POA. Possible values are:
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							ORB_CTRL_MODEL (default): The POA is responsible for assigning requests to threads.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							SINGLE_THREAD_MODEL: The POA processes requests sequentially 
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+			<listitem>
+				<para>
+					<emphasis>Lifespan policy:</emphasis> Specifies the lifespan of the objects implemented in the POA. The lifespan policy can have the following values: 
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							TRANSIENT (Default) Objects implemented in the POA cannot outlive the  process in which they are first created. Once the POA is deactivated, an OBJECT_NOT_EXIST exception occurs when attempting to use any object references generated by the POA.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							PERSISTENT Objects implemented in the POA can outlive the process in which they are first created.
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+			<listitem>
+				<para>
+					Object ID Uniqueness policy: Allows a single servant to be shared by many abstract objects. The Object ID Uniqueness policy can have the following values: 
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							UNIQUE_ID (Default): Activated servants support only one Object ID. 
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							MULTIPLE_ID: Activated servants can have one or more Object IDs. The Object ID must be determined within the method being invoked at run time.
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+			<listitem>
+				<para>
+					ID Assignment policy: Specifies whether object IDs are generated by server applications or by the POA. The ID Assignment policy can have the following values:
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							USER_ID is for persistent objects, and 
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							SYSTEM_ID is for transient objects.
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+			<listitem>
+				<para>
+					Servant Retention policy: Specifies whether the POA retains active servants in the Active Object Map. The Servant Retention policy can have the following values: 
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							RETAIN (Default) The POA tracks object activations in the Active Object Map. RETAIN is usually used with ServantActivators or explicit activation methods on POA.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							NON_RETAIN The POA does not retain active servants in the Active Object Map. NON_RETAIN is typically used with ServantLocators.
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+			<listitem>
+				<para>
+					Request Processing policy: Specifies how requests are processed by the POA.
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							USE_ACTIVE_OBJECT_MAP (Default): If the Object ID is not listed in the Active Object Map, an OBJECT_NOT _EXIST exception is returned. The POA must also use the RETAIN policy with this value.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							USE_DEFAULT_SERVANT: If the Object ID is not listed in the Active Object Map or the NON_RETAIN policy is set, the request is dispatched to the default servant. If no default servant has been registered, an OBJ_ADAPTER exception is returned. The POA must also use the MULTIPLE_ID policy with this value.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							USE_SERVANT_MANAGER: If the Object ID is not listed in the Active Object Map or the NON_RETAIN policy is set, the servant manager is used to obtain a servant.
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+			<listitem>
+				<para>
+					Implicit Activation policy: Specifies whether the POA supports implicit activation of servants. The Implicit Activation policy can have the following values:
+				</para>
+				<itemizedlist>
+					<listitem>
+						<para>
+							IMPLICIT_ACTIVATION: The POA supports implicit activation of servants.  Servants can be activated by converting them to an object reference with <methodname>org.omg.PortableServer.POA.servant_to_reference()</methodname> or by invoking <methodname>_this()</methodname> on the servant. The POA must also use the SYSTEM_ID and RETAIN policies with this value.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							NO_IMPLICIT_ACTIVATION (Default): The POA does not support implicit activation of servants.
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+		</itemizedlist>
+		<para>
+			It appears that to redirect replay_completion invocations to a default servant we need  to create a POA with the Request Processing policy assigned with the value set to USE_DEFAULT_SERVANT. However to reach that default Servant we should first reach the POA that forward the request to the default servant. Indeed, the ORB uses a set of information to retrieve a POA; these information are contained in the object reference used by the client. Among these information there are the IP address and the port number where resides the server and also the POA name. To perform replay_completion invocations, the solution adopted by JBossTS is to provide one Servant, per machine, and located in the RecoveryManager process, a separate process from client or server applications. The next section explains how the indirection to a default Servant located on a separate process is provided for ORBIX and for JacORB. 
+		</para>
 	</section>
-
+	<section id="sect-Transactions_Failure_Recovery_Guide-How_JBossTS_manages_the_OTS_Recovery_Protocol-The_default_RecoveryCoordinator_in_Orbix">
+		<title>The default RecoveryCoordinator in Orbix</title>
+		<para>
+			Within Orbix, objects are located by the Location Deamon. To avoid the overhead of using the location daemon, Orbix provides a mechanism named <emphasis>Direct Persistence</emphasis> allowing generating persistent object references. This mechanism is in fact a proprietary policy named, DIRECT_PERSISTENCE. A POA with policies of PERSISTENT and DIRECT_PERSISTENCE generates IORs that contain a well-known address for the server process. A POA that uses direct persistence must also tell each transport mechanism such as IIOP where in the configuration file it can find the well-known address that it should use. This is done by creating a <code>WellKnownAddressingPolicy</code> object and setting its value to the configuration scope that contains the well-known address. 
+		</para>
+		<para>
+			To specify the address used by the <code>WellKnownAddressingPolicy</code> object, JBossTS uses the Orbix mechanism that allows specifying an ORB/POA names. The following configuration modifications are necessary to define the well-know address of the RecoveryCoordinator performing replay_completion invocation. 
+		</para>
+		<note>
+			<para>
+				Note that this configuration is also necessary to support transaction context propagation and interposition.
+			</para>
+		</note>
+		<para>
+			A new orb name domain called arjuna should be created within the main Orbix 2000 domain being used by the application. It requires the following format:
+		</para>
+<screen>
+arjuna
+{
+	portable_interceptor
+	{
+		orb_plugins = ["local_log_stream", "iiop_profile", "giop", "iiop", "portable_interceptor"];
+	
+		ots_recovery_coordinator
+		{
+			recovery_coordinator:iiop:addr_list = [“&lt;name&gt;:&lt;port&gt;”];
+		};
+			
+		ots_transaction
+		{
+			transaction:iiop:addr_list = [“+&lt;name&gt;:&lt;port&gt;”];
+		};     
+		ots_context
+		{
+			binding:client_binding_list = ["OTS_Context", "OTS_Context+GIOP+SIOP", "GIOP+SIOP", "OTS_Context+GIOP+IIOP", "GIOP+IIOP"];
+			binding:server_binding_list = ["OTS_Context", ""];
+		};
+					
+		ots_interposition
+		{
+			binding:client_binding_list = ["OTS_Interposition", "OTS_Interposition+GIOP+SIOP", "GIOP+SIOP", "OTS_Interposition+GIOP+IIOP", "GIOP+IIOP"];
+			binding:server_binding_list = ["OTS_Interposition", ""];
+		};
+	};
+};
+</screen>
+		<para>
+			The &lt;name&gt; field should be substituted by the name of the machine on which JBossTS is being run. The &lt;port&gt; field should be an unused port on which the JBossTS recovery manager may listen for recovery requests. 
+		</para>
+		<para>
+			Because of the way in which Orbix works with persistent POAs, if you want crash recovery support for your applications you must use one of the  Arjuna ORB names provided (context or interposition) when running your clients and services. When using transaction context propagation only, the<parameter>–ORBname arjuna.portable_interceptor.ots_context</parameter> parameter should be passed to the client and server. When using context propagation and interposition, the <parameter>–ORBname.arjuna.portable_interceptor.ots_interposition</parameter> parameter should be used. For example:
+		</para>
+<screen>
+java mytest –ORBname arjuna.portable_interceptor.ots_context
+</screen>
+		<formalpara>
+			<title>How it works</title>
+			<para>
+				When the Recovery Manager is launched it seeks in the configuration the RecoveryActivator that need be loaded. Once done it invokes the <methodname>startRCservice</methodname> method of each loaded instances. As seen in in the previous chapter (Recovery Manager) the class to load that implements the <interfacename>RecoveryActivator</interfacename> interface  is the class <classname>RecoveryEnablement</classname>. This generic class, located in the package <package>com.arjuna.ats.internal.jts.orbspecific.recovery</package>, hides the nature of the ORB being used by the application. The following figure illustrates the behavior of the <interfacename>RecoveryActivator</interfacename> that leads to the creation of the default servant that performs all replay_invocations requests. 
+			</para>
+		</formalpara>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/Recovery_Manager.png" format="PNG"/>
+			</imageobject>
+			<caption>The Recovery Manager and the creation of the default servant for RecoveryCoordinator.</caption>
+		</mediaobject>
+		<note>
+			<para>
+				There is one recovery Manager Process per machine, then one default servant per machine. Performing all replay_completion invocations means those made on the same machine.
+			</para>
+		</note>
+		<para>
+			When started, the application, using JBossTS in library mode, is launched a child POA is created with the same policies as those defined within the Recovery Manager. This child POA is used to create object references, for RecoveryCoordinator CORBA objects, that need to be returned on register_resource invocations, as illustrated in figure below. The Object reference created has an Object ID that contains the transaction ID in progress and the Process Identifier of the application. 
+		</para>
+		<note>
+			<para>
+				If the Transaction Service is used in the stand-alone mode, the behavior to create object reference to RecoveryCoordinator objects is exactly the same; the process ID used in the Object ID is the Transaction Service process ID
+			</para>
+		</note>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/Application_Process.png" format="PNG"/>
+			</imageobject>
+			<caption>Resource registration and returned RecoveryCoordinator Object reference.</caption>
+		</mediaobject>
+		<para>
+			Having the object reference of the RecoveryCoordinator, an application can use it to determine the status of the transaction for which that object reference is created. When a RecoveryCoordinator, according to POA policies assigned to the POA included in the object reference, the request is forward straightforward to the default servant defined in the Recovery Manager, as described in the figure below. 
+		</para>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/Transaction_Process.png" format="PNG"/>
+			</imageobject>
+			<caption>replay_completion invocation forwarded to the default RecoveryCoordinator .</caption>
+		</mediaobject>
+		<para>
+			The flow described in the figure can be depicted as follow:
+		</para>
+		<orderedlist>
+			<listitem>
+				<para>
+					The participant invokes the replay_completion operation on RecoveryCoordinator object using the object reference returned by the Transaction Server.
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					The request is forwarded to the Recovery Manager process since the Well-known-address policy is used to retrieve. 
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					The child POA responsible to locate the servant is retrieved.
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					After looking to the Active Object Map, the child POA invokes the default servant to perform the request. Note that the Object ID conveyed by the object reference is not retrieved in the AOP. 
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					The servant extracts from the request the Object ID that contains the Transaction ID and the process ID of the Transaction Server process. To determine if the process still alive, the TransactionStatusConnectionManager functionalities are used.
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					According to the presence or not of the Transaction Server process and eventually the returned status, the servant returns the status of the transaction asked by the participant.
+				</para>
+			</listitem>
+		</orderedlist>
+	</section>
+	<section id="sect-Transactions_Failure_Recovery_Guide-How_JBossTS_manages_the_OTS_Recovery_Protocol-The_default_RecoveryCoordinator_in_JacOrb">
+		<title>The default RecoveryCoordinator in JacOrb</title>
+		<para>
+			JacORB does not define additional policies to redirect any request on a RecoveryCoordinator object to a default servant located in the Recovery Manager process. However it provides a set of APIs that allows building object references with specific IP address, port number and POA name in order to reach the appropriate default servant.
+		</para>
+		<formalpara>
+			<title>How it works</title>
+			<para>
+				When the Recovery Manager is launched it seeks in the configuration the RecoveryActivator that need be loaded. Once done it invokes the <methodname>startRCservice</methodname> method of each loaded instances. As seen in in the previous chapter (Recovery Manager ) the class to load that implements the <interfacename>RecoveryActivator</interfacename> interface  is the class <classname>RecoveryEnablement</classname>. This generic class, located in the package <package>com.arjuna.ats.internal.jts.orbspecific.recovery</package>, hides the nature of the ORB being used by the application (JacORB). The following figure illustrates the behavior of the <interfacename>RecoveryActivator</interfacename> that leads to the creation of the default servant that performs replay_completion invocations requests. 
+			</para>
+		</formalpara>
+		<para>
+			In addition to the creation of the default servant, an object reference to a <code>RecoveryCoordinator</code> object is created and stored in the ObjectStore. As we will see this object reference will be used to obtain its IP address, port number and POA name and assign them to any <code>RecoveryCoordinator</code> object reference created on register_resource. 
+		</para>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/Recover_Manager_Flow.png" format="PNG"/>
+			</imageobject>
+			<caption>replay_completion invocation forwarded to the default RecoveryCoordinator.</caption>
+		</mediaobject>
+		<para>
+			When an application registers a resource with a transaction, a <code>RecoveryCoordinator</code> object reference is expected to be returned. To build that object reference, the Transaction Service uses the RecoveryCoordinator object reference created within the Recovery Manager as a template. The new object reference contains practically the same information to retrieve the default servant (IP address, port number, POA name, etc.), but the Object ID is changed; now, it contains the Transaction ID of the transaction in progress and also the Process ID of the process that is creating the new <code>RecoveryCoordinator</code> object reference, as illustrated below. 
+		</para>
+		<mediaobject>
+			<imageobject>
+				<imagedata fileref="images/RecoverCoordinator_Object.png" format="PNG"/>
+			</imageobject>
+			<caption>Resource registration and returned RecoveryCoordinator Object reference build from a reference stored in the ObjectStore.</caption>
+		</mediaobject>
+		<para>
+			Since a <code>RecoveryCoordintaor</code> object reference returned to an application contains all information to retrieve the POA then the default servant located in the Recovery Manager, all replay_completion invocation, per machine, are forwarded to the same default <code>RecoveryCoordinator</code> that is able to retreive the Object ID from the incoming request to extract the transaction identifier and the process identifier needed to determine the status of the requested transaction.
+		</para>
+	</section>
 </chapter>
 




More information about the jboss-cvs-commits mailing list