Implementing transaction management with the web UI framework
You can implement transaction management by using either a custom or default implementation.
- A custom implementation of transaction management that uses the
interface classes of the Web UI Framework.
Applications need to register their implementation for the ISCUITransactionContextFactory class either as a context parameter or by making a Java™ call to the method SCUITransactionContextHelper.setTransactionContextFactory.
Registering can be done by either of the following methods:- Calling the static setter method SCUITransactionContextHelper.setTransactionContextFactory
- Adding a context parameter scui-transaction-context-factory with
the value as the implementation class name. In this case, the helper
class will instantiate the context factory.
<context-param> <param-name>scui-transaction-context-factory</param-name> <param-value> com.sterlingcommerce.app.TransactionContextFactory </param-value> </context-param>
In both methods, the Web UI Framework will call the init method of the ISCUITransactionContextFactory class just after registering it. Applications can use this method do some initializations for the factory.
Errors might occur if a factory class is not provided or if a class registered using the context parameter does not implement the interface ISCUITransactionContextFactory. In either of these situations, if a transaction context is requested, Web UI Framework will throw a SCUIException with the proper error message.
- The default implementation of the Web UI Framework. You can customize
this implementation. Use the following interface classes:
- YFSContext
- YCPUIAPIManager
The Web UI Framework provides the same transaction management functionalities as the previous version of the application.