JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Administration Guide
search filter icon
search icon

Document Information

Preface

1.  Overview of GlassFish Server Administration

Default Settings and Locations

Configuration Tasks

Administration Tools

Instructions for Administering GlassFish Server

Part I Runtime Administration

2.  General Administration

3.  Administering Domains

4.  Administering the Virtual Machine for the Java Platform

5.  Administering Thread Pools

6.  Administering Web Applications

7.  Administering the Logging Service

8.  Administering the Monitoring Service

9.  Writing and Running JavaScript Clients to Monitor GlassFish Server

10.  Administering Life Cycle Modules

11.  Extending and Updating GlassFish Server

Part II Resources and Services Administration

12.  Administering Database Connectivity

13.  Administering EIS Connectivity

14.  Administering Internet Connectivity

15.  Administering the Object Request Broker (ORB)

16.  Administering the JavaMail Service

17.  Administering the Java Message Service (JMS)

18.  Administering the Java Naming and Directory Interface (JNDI) Service

19.  Administering Transactions

About Transactions

Transaction Resource Managers

Transaction Scope

Configuring the Transaction Service

Managing the Transaction Service for Rollbacks

To Stop the Transaction Service

To Roll Back a Transaction

To Restart the Transaction Service

Determining Local Transaction Completion at Shutdown

Recovering Transactions

Automatic Transaction Recovery

To Manually Recover Transactions

Distributed Transaction Recovery

Recovery Workarounds and Limitations

General Recovery Limitations

Oracle Setup for Transaction Recovery

Oracle Thin Driver

Delegated Recovery After Server Crash Doesn't Work on MySQL

Call to XATeminator.recover() During ResourceAdapter.start() Hangs If Automatic Recovery Is Enabled

Transaction Logging

To Store Transaction Logs in a Database

Part III Appendixes

A.  Subcommands for the asadmin Utility

Index

Transaction Logging

The transaction service writes transactional activity into transaction logs so that transactions can be recovered. You can control transaction logging in these ways:


Note - All instances in a cluster must be owned by the same user (uid), and read/write permissions for that user must be set on the transaction log directories.

Transaction logs should be stored in a high-availability network file system (NFS) to avoid a single point of failure.


To Store Transaction Logs in a Database

For multi-core machines, logging transactions to a database may be more efficient.

This feature is intended for resource recovery on a standalone server instance while the instance is healthy, not for a server crash. It is not intended for use on a cluster.

  1. Create a JDBC connection Pool, and set the non-transactional-connections attribute to true.
  2. Create a JDBC resource that uses the connection pool and note the JNDI name of the JDBC resource.
  3. Create a table named txn_log_table with the following schema:
    Column Name
    JDBC Type
    LOCALTID
    BIGINT
    SERVERNAME
    VARCHAR(n)
    GTRID
    VARBINARY

    The size of the SERVERNAME column should be at least the length of the GlassFish Server host name plus 10 characters.

    The size of the GTRID column should be at least 64 bytes.

  4. Add the db-logging-resource property to the transaction service. For example:
    asadmin set server-config.transaction-service.property.db-logging-resource="jdbc/TxnDS"

    The property's value should be the JNDI name of the JDBC resource configured previously.

  5. To disable file synchronization, use the following asadmin create-jvm-options command:
    asadmin create-jvm-options -Dcom.sun.appserv.transaction.nofdsync
  6. Restart the server.

Next Steps

To define the SQL used by the transaction manager when it is storing its transaction logs in the database, use the following flags:

-Dcom.sun.jts.dblogging.insertquery=sql statement

-Dcom.sun.jts.dblogging.deletequery=sql statement

The default statements are as follows:

-Dcom.sun.jts.dblogging.insertquery=insert into txn_log_table values ( ?, ?, ? )

-Dcom.sun.jts.dblogging.deletequery=delete from txn_log_table where localtid = ? and servername = ?

To set one of these flags using the asadmin create-jvm-options command, you must quote the statement. For example:

create-jvm-options '-Dcom.sun.jts.dblogging.deletequery=delete from txn_log_table where gtrid = ?'

You can also set JVM options in the Administration Console. Select the JVM Settings component under the relevant configuration. These flags and their statements must also be quoted in the Administration Console. For example:

'-Dcom.sun.jts.dblogging.deletequery=delete from txn_log_table where gtrid = ?'

See Also

For information about JDBC connection pools and resources, see Chapter 12, Administering Database Connectivity. For more information about the asadmin create-jvm-options command, see the Oracle GlassFish Server 3.1-3.1.1 Reference Manual.