The transactional state of a component instance determines whether a transactional component’s database updates are committed or rolled back.
To set transactional state, you must use the InstanceContext object retrieved by calling Jaguar.getInstanceContext() in each method that sets transactional state (do not save the object across method invocations, because it will not be valid if the component instance has been deactivated and reactivated). See the EAServer API Reference Manual for information on this method.
To set transaction state, choose the method that reflects the state of the work that the component is contributing to the transaction, as follows:
If the work is complete and without error, call setComplete.
Call setRollbackOnly if the work cannot be completed. Alternatively, throw the exception org.omg.CORBA.TRANSACTION_ROLLEDBACK. If the error indicates an internal inconsistency in the application, log a description of the error to help debug the problem as described in “Add error handling code”.
Transaction control with the ServerBean control interface
If you use the deprecated control interface JaguarEJB::ServerBean and
Auto demarcation/deactivation option is disabled in the
Transactions tab in the Transactions properties for your component,
the transaction state specified in the method determines whether
the instance is deactivated or remains bound to the client.