<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>
  <header>
    <copyright>
      <year>1999</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>Installing cosTransactions</title>
    <prepared></prepared>
    <docno></docno>
    <date>1999-04-20</date>
    <rev></rev>
    <file>ch_install.xml</file>
</header>

  <section>
    <title>Installation Process </title>
    <p>This chapter describes how to install 
      <seealso marker="cosTransactions">cosTransactions</seealso> 
      in an Erlang Environment.
      </p>

    <section>
      <title>Preparation</title>
      <p>Before starting the installation process for cosTransactions,
        the application Orber must be running.</p>
      <p>The cosTransactions application must be able to log progress to disk. The log files are
        created in the current directory as "oe_name@machine_type_timestamp". Hence, <c>read</c> and 
        <c>write</c> rights must be granted. If the transaction completes in an orderly fashion the 
        logfiles are removed, but not if an error, which demands human intervention, occur.</p>
    </section>

    <section>
      <title>Configuration</title>
      <p>When using the Transaction Service the <c>cosTransactions</c> application 
        must be started using either <c>cosTransactions:start()</c> or 
        <c>application:start(cosTransactions)</c>.
        </p>
      <p>The following application configuration parameters exist:</p>
      <list type="bulleted">
        <item><c>maxRetries</c> - default is 40 times, i.e., if a transaction participant is unreachable
         the application will retry to contact it <c>N</c> times. Reaching the maximum is considered to be a disaster.</item>
        <item><c>comFailWait</c> - default is 5000 milliseconds, i.e., before the application
         retries to contact unreachable transaction participants the application wait <c>Time</c> milliseconds.</item>
      </list>
      <p>Then the <seealso marker="CosTransactions_TransactionFactory">Transaction Factory</seealso>
        must be started:</p>
      <list type="bulleted">
        <item><c>cosTransactions:start_factory()</c> - starts and returns a reference to a factory using default configuration parameters.</item>
        <item><c>cosTransactions:start_factory(Options)</c> - starts and returns a reference to a factory using given configuration parameters.</item>
      </list>
      <p>The following options exist:
        </p>
      <list type="bulleted">
        <item><c>{hash_max, HashValue}</c> - 
         This value denotes the upper bound of the hash value the <seealso marker="CosTransactions_Coordinator">Coordinator</seealso>  uses.
         Default is <c>1013</c>. HashValue must be an integer.</item>
        <item><c>{allow_subtr, Boolean}</c> -
         If set to true it is possible to create <seealso marker="CosTransactions_Coordinator">subtransactions</seealso>.
         Default is <c>true</c>.</item>
        <item><c>{typecheck, Boolean}</c> -
         If set to to true all transaction operation's arguments will be type-checked.
         Default is <c>true</c>.</item>
        <item><c>{tty, Boolean}</c> -  
         Enables or disables error printouts to the tty. 
         If Flag is false, all text that the error logger would have sent to the terminal is discarded. 
         If Flag is true, error messages are sent to the terminal screen. </item>
        <item><c>{logfile, FileName}</c> -
         This function makes it possible to store all system information in <c>FileName</c> (string()).
         It can be used in combination with the tty(false) item to have a silent system, 
         where all system information are logged to a file. 
         As default no logfile is used.</item>
        <item><c>{maxRetries, Integer}</c> -
         default is 40 times, i.e., if a transaction participant is unreachable the application will 
         retry to contact it <c>N</c> times. Reaching the maximum is considered to be a disaster.
         This option overrides the application configuration parameter.</item>
        <item><c>{comFailWait, Integer}</c> -
         default is 5000 milliseconds, i.e., before the application retries to contact unreachable 
         transaction participants the application wait <c>Time</c> milliseconds.
         This option overrides the application configuration parameter.</item>
      </list>
      <p>The Factory is now ready to use. For a more detailed description see <seealso marker="ch_example">Examples</seealso>.
        </p>
    </section>
  </section>
</chapter>

