1. Overview of GlassFish Server Administration
Default Settings and Locations
Instructions for Administering GlassFish Server
4. Administering the Virtual Machine for the Java Platform
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
Configuring the Transaction Service
Managing the Transaction Service for Rollbacks
To Stop the Transaction Service
To Restart the Transaction Service
Determining Local Transaction Completion at Shutdown
Automatic Transaction Recovery
To Manually Recover Transactions
Distributed Transaction Recovery
Recovery Workarounds and Limitations
Oracle Setup for Transaction Recovery
Delegated Recovery After Server Crash Doesn't Work on MySQL
Call to XATeminator.recover() During ResourceAdapter.start() Hangs If Automatic Recovery Is Enabled
The transaction service writes transactional activity into transaction logs so that transactions can be recovered. You can control transaction logging in these ways:
Set the location of the transaction log files in one of these ways:
Set the GlassFish Server's log-root setting to a shared file system base directory and set the transaction service's 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:
asadmin> create-system-properties --target server TX-LOG-DIR=/inst1/logs
For information about setting log-root and other general logging settings, see Chapter 7, Administering the Logging Service.
Turn off transaction logging by setting the disable-distributed-transaction-logging property to true and the automatic-recovery attribute to false. Do this only if performance is more important than transaction recovery.
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.
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.
|
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.
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.
asadmin create-jvm-options -Dcom.sun.appserv.transaction.nofdsync
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.