The transactional state of a component instance determines whether a transactional component’s database updates are committed or rolled back.
In components that use the CtsComponents::ObjectControl control interface, each instance receives a CtsComponents::ObjectContext object each time that EAServer calls the setObjectContext method. The object reference is valid until unsetObjectContext is called. For more information on these methods, see the generated HTML documentation in the html/ir directory of your EAServer installation.
In classes that do not implement a control interface, call 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.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |