Example: Basic transactional producer
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
The following code example shows how to construct and send multiple records using a transactional producer. By using a transaction, the client ensures that all the records are sent successfully, or none of the records are sent.
The producer is configured with a transactional identifier (through a call to
SetTransactionalId()), which enables a
transactional producer. After the transactional producer is created, the transactional
state is initialized with a call to InitTransactions().
Transaction scope is managed through calls to BeginTransaction(), CommitTransaction(),
and AbortTransaction(). The same Send() method is used for sending records, as with a non-transactional
producer.
|