You can manage transactions through the interface contracts of the web UI
framework.
For more information, refer to the Java™ API documentation in your installation
directory (<INSTALL_DIR>/xapidocs/core_javadocs).
Interface Contract |
Description |
Methods |
ISCUITransactionContext |
ISCUITransactionContext defines the behavior expected
in any implementation of transaction context in an application. |
- begin
Called on the beginning of the current transaction. Can
be used to prepare connections to data sources.
- commit
Commits all of the changes for the current transaction.
Called after the successful execution of all of the tasks for the
current transaction.
- rollback
Called if any of the tasks for the current transaction
fails. You can roll back all of the changes made during that transaction.
- end
Called when the current transaction ends. You can use this
method to close all of the connections made to the data sources for
that transaction.
- addTransactionObject
Adds multiple connections to a transaction
context.
- removeTransactionObject
Removes connections to a transaction
context.
- getTransactionObject
Fetches an already-added transaction object
from the transaction context.
|
ISCUITransactionContextFactory |
Defines the behavior expected in any implementation
of a Transaction Context Factory in an application. |
- createTransactionContext
Creates a Transaction Context for a
transaction. You can either create a new Transaction Context for fetch
it from a Transaction Context pool and return it.
- releaseTransactionContext
Called when a transaction finishes.
This method can either destroy a Transaction Context or return it
to the pool.
- init
Instantiates a class when the first call for a Transaction
Context is made. This method is called once for a Transaction Factory
during instantiation.
- sessionDestroyed
Called when a session is destroyed. You can
choose to perform an action based on the session destroyed.
The
ISCUITransactionContextFactory class extends the ISCUISessionAware
class, which is a marker class that helps the ISCUITransactionContextFactory
class register itself to the HttpSessionListener implementation class.
|
Transaction management also includes the following
helper class which an application needs for transaction management-related
tasks.
Class Name |
Description |
Methods |
SCUITransactionContextHelper
|
Acts as a controller for transaction management. |
- setTransactionContextFactory
Registers the transaction context
factory of an application. You can use this method to initialize and
register a factory during the start of a web application.
For
any transaction context request, the SCUITransactionContextHelper
class first looks to see if a factory is set. If not, the class tries
to instantiate a factory using a context parameter. If a parameter
is not found, an error is thrown. Once instantiated, the same instance
is used for further references unless another context is set using
the setTransactionContextFactory method.
- getTransactionContextFactory
Returns the Current Transaction Context
Factory for an application. Returns null if no Factory is set
or loaded.
|