Sun GlassFish Enterprise Server 2.1 Administration Reference

transaction-service

Configures the Java Transaction Service (JTS).

Superelements

config

Subelements

The following table describes subelements for the transaction-service element.

Table 1–180 transaction-service Subelements

Element 

Required 

Description 

property

zero or more 

Specifies a property or a variable. 

Attributes

The following table describes attributes for the transaction-service element.

Table 1–181 transaction-service Attributes

Attribute 

Default 

Description 

automatic-recovery

false (developer profile)

true (cluster and enterprise profiles)

(optional) If true, the server instance attempts transaction recovery during startup.

timeout-in-seconds

0

(optional) Specifies the amount of time after which the transaction is aborted. If set to 0, the transaction never times out.

tx-log-dir

directory specified by the log-root attribute of the domain element

(optional) Specifies the parent directory of the transaction log directory instance-name/tx. The directory in which the transaction logs are kept must be writable by the user account under which the server runs. A relative path is relative to the log-root attribute of the domain element.

heuristic-decision

rollback

(optional) If the outcome of a distributed transaction cannot be determined because other participants are unreachable, this property determines the outcome. Allowed values are rollback and commit.

retry-timeout-in-seconds

600

(optional) Determines the retry time in the following scenarios: 

  • At the transaction recovery time, if resources are unreachable.

  • If there are any transient exceptions in the second phase of a two phase commit protocol.

    A negative value specifies infinite retries. A value of 0 (zero) specifies no retries. A positive value indicates the time after which a retry is attempted.

keypoint-interval

65536 (64 K)

(optional) Specifies the number of transactions between keypoint operations in the log. Keypoint operations reduce the size of the transaction log file by compressing it. A larger value for this attribute results in a larger transaction log file, but fewer keypoint operations and potentially better performance. A smaller value results in smaller log files, but slightly reduced performance due to the greater frequency of keypoint operations. 

Properties

The following table describes properties for the transaction-service element.

Table 1–182 transaction-service Properties

Property 

Default 

Description 

oracle-xa-recovery-workaround

true

If true, the Oracle XA Resource workaround is used in transaction recovery.

disable-distributed-transaction-logging

false

If true, disables transaction logging, which might improve performance.

If the automatic-recovery attribute is set to true , this property is ignored.

xaresource-txn-timeout

specific to the XAResource used

Changes the XAResource timeout. In some cases, the XAResource default timeout can cause transactions to be aborted, so it is desirable to change it.

pending-txn-cleanup-interval

none if this property is absent, 60 if this property is present but has no value

Specifies the interval, in seconds, at which an asynchronous thread checks for pending transactions and completes them. 

use-last-agent-optimization

true

If true, enables last agent optimization, which improves the throughput of transactions. If one non-XA resource is used with XA resources in the same transaction, the non XA resource is the last agent.

delegated-recovery

false

If true, cluster-wide delegated recovery is enabled. You must also facilitate storing of transaction logs in a shared file system in one of these ways:

  • Set the domain element's log-root attribute to a shared file system base directory and set the tx-log-dir attribute to a relative path.

  • Set tx-log-dir to an absolute path to a shared file system directory, in which case log-root is ignored for transaction logs.

  • Set a system-property called TX-LOG-DIR to a shared file system directory. For example:

<server config-ref="server-config" name="server">
   <system-property name="TX-LOG-DIR" 
      value="/net/tulsa/nodeagents/na/instance1/logs"/>
</server>

wait-time-before-recovery-insec

60

Specifies the wait time, in seconds, after which an instance starts the recovery for a dead instance. 

db-logging-resource

none 

Specifies the JNDI name of the JDBC resource for the database to which transactions are logged. For more information, see Chapter 16, Using the Transaction Service, in Sun GlassFish Enterprise Server 2.1 Developer’s Guide.

xa-servername

host name on which the Enterprise Server runs 

Specifies the host name that the transaction service uses to identify transactions being managed by the installed Enterprise Server. This can sometimes be useful for recovering transactions from the log file that was created on a different host running the Enterprise Server. This should also be used when the Enterprise Server is installed as part of Sun Cluster HA.