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
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
To Store Transaction Logs in a Database
You can roll back a single transaction by using the asadmin subcommands described in this section. To do so, the transaction service must be stopped (and later restarted), allowing you to see the active transactions and correctly identify the one that needs to be rolled back.
The following topics are addressed here:
Use the freeze-transaction-service subcommand in remote mode to stop the transaction service. When the transaction service is stopped, all in-flight transactions are immediately suspended. You must stop the transaction service before rolling back any in-flight transactions.
Running this subcommand on a stopped transaction subsystem has no effect. The transaction service remains suspended until you restart it by using the unfreeze-transaction-service subcommand.
Remote subcommands require a running server.
Example 19-1 Stopping the Transaction Service
This example stops the transaction service.
asadmin> freeze-transaction-service --target instance1 Command freeze-transaction-service executed successfully
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help freeze-transaction-service at the command line.
In some situations, you might want to roll back a particular transaction. Before you can roll back a transaction, you must first stop the transaction service so that transaction operations are suspended. Use the rollback-transaction subcommand in remote mode to roll back a specific transaction.
Remote subcommands require a running server.
asadmin> set cluster1-config.monitoring-service.module-monitoring-levels.transaction-service=HIGH
To see a list of IDs of active transactions, use the get subcommand with the --monitor option to get the monitoring data for the activeids statistic. See Transaction Service Statistics. For example:
asadmin> get --monitor instance1.server.transaction-service.activeids-current
The transaction is not rolled back at the time of this command's execution, but only marked for rollback. The transaction is rolled back when it is completed.
Example 19-2 Rolling Back a Transaction
This example rolls back the transaction with transaction ID 0000000000000001_00.
asadmin> rollback-transaction --target instance1 0000000000000001_00 Command rollback-transaction executed successfully
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help rollback-transaction at the command line.
Use the unfreeze-transaction-service subcommand in remote mote to resume all the suspended in-flight transactions. Run this subcommand to restart the transaction service after it has been frozen.
Remote subcommands require a running server.
Example 19-3 Restarting the Transaction Service
This example restarts the transaction service after it has been frozen.
asadmin> unfreeze-transaction-service --target instance1 Command unfreeze-transaction-service executed successfully
See Also
You can also view the full syntax and options of the subcommand by typing asadmin help unfreeze-transaction-service at the command line.
When you shut down a GlassFish Server instance, all database connections are closed. When an Oracle JDBC driver-based database connection is closed in the middle of a non-XA transaction, all pending changes are committed. Other databases usually roll back pending changes when a connection is closed without being explicitly committed. To determine the exact behavior for your database, refer to the documentation from your JDBC driver vendor.
To explicitly specify whether GlassFish Server commits or rolls back non-XA transactions at server shutdown, set the com.sun.enterprise.in-progress-local-transaction.completion-mode JVM option to either commit or rollback using the create-jvm-options(1) subcommand. For example:
asadmin> create-jvm-options -Dcom.sun.enterprise.in-progress-local-transaction.completion-mode=rollback