Appendix C: Creating C Components
Figure C-1 illustrates the states in the lifetime of a C component instance:
Figure C-1: C component lifecycle
The state transitions are:
New instance – a new C component instance is created whenever a client application instantiates a stub for the component. At this point, the EAServer runtime calls the component’s create routine (see “Customize the creation and destruction of components”).
In Method – in response to a method invocation request from the client, the EAServer runtime calls the C routine that implements the method. The next state depends on which of the transaction state primitives is called.
If JagCompleteWork or JagRollbackWork is called, the instance is destroyed when the method invocation completes.
If JagContinueWork or JagDisallowCommit is called, the instance persists when the method invocation completes.
If the component is transactional, the routine that is called also influences the outcome of the transaction that the component is participating in.
Chapter 5, “C Routines Reference,” in the EAServer API Reference contains reference pages for the C routines. Chapter 2, “Understanding Transactions and Component Lifecycles” describes EAServer’s transaction model.
Destruction – if the method called JagCompleteWork or JagRollbackWork, the instance is destroyed when the method completes. An instance is also destroyed when the client destroys its stub instance or if the client disconnects abruptly without explicitly destroying the stub.
|Copyright © 2005. Sybase Inc. All rights reserved.|