Appendix D Creating C Components
The definition of a C component specifies the interfaces that the component implements as well as its other properties.
The component's transaction property determines how it participates in transactions. The threading property imposes constraints on concurrent execution of the component.
All component interfaces for Jaguar components are defined in CORBA IDL modules that are stored in Jaguar's IDL Repository. Chapter 6, "Defining Component Interfaces" describes how to define IDL interfaces.
Component developers typically use one of the following to define the interface or interfaces that their component implements:
IDL interfaces for C components cannot have create and destroy methods. These conflict with the C create and destroy functions that are called when your component is instantiated and destroyed, respectively.
The component's transaction property determines how it participates in transactions. You can view and change this property using the Transactions tab of the component's property sheet.
When you mark a component as "Requires Transaction," commands that the component sends to third-tier database servers are automatically performed within a transaction. By default, components are not transactional.
Transactional component attribute describes the settings for this attribute. Chapter 3, "Understanding Transactions and Component Lifecycles" introduces the Jaguar transaction processing model.
The Instances property imposes constraints on the concurrent execution of the component in different threads. You can view and change these properties using the Instances tab of the component's property sheet.
For a single-threaded component, multiple instances may exist simultaneously, but only one can be active at any one time. Jaguar synchronizes instantiations, method invocations, and destructions of all instances. Use the single-threaded model if your component shares volatile global data or stateful resources between instances. For example, volatile global data might be a counter that is stored in a global variable. Sharing a stateful resource would occur if, for example, every component instance opened the same file and wrote text to it. Either example requires the single-threading model. To enable single-threading, do not select any of the options in the Instance Properties tab.
The following settings specify the constraints that are placed on concurrent execution of different instances of the component. The choices are:
Copyright © 2000 Sybase, Inc. All rights reserved. |