Oracle8i Enterprise JavaBeans and CORBA Developer's Guide
Release 8.1.5

A64683-01

Library

Product

Contents

Index

Prev  Chap Top Next

CORBA Examples

This section shows some examples that use the JTS interface for CORBA client code and CORBA server objects. See "Transaction Examples" for a set of complete examples that you can run and modify.

Client-Side Demarcation

Follow these steps to use JTS methods in your CORBA client code:

For example:

import oracle.aurora.jndi.sess_iiop.ServiceCtx;
import oracle.aurora.jts.client.AuroraTransactionService;
import oracle.aurora.jts.util.TS;
import org.omg.CosTransactions.*;
// Include normal startup code...
// Initialize a transaction context...
AuroraTransactionService.initialize(ic, serviceURL);

// Begin a transaction...
oracle.aurora.jts.util.TS.getTS().getCurrent().begin();

// Call methods that involve SQL DML...
employee.updateEmployee(info);
...
// Commit (or roll back) the SQL statements...
oracle.aurora.jts.util.TS.getTS().getCurrent().commit(false);

For a complete example that uses these techniques for client-side transaction demarcation, see "clientside".

Server-Side JTS

Follow these steps to use JTS methods in your CORBA server object code:

You can also invoke other JTS methods, such as set_timeout(), from within a server object.

See the complete example at "serversideJTS" for a demonstration of CORBA server-side transaction demarcation.

Transactions in Multiple Sessions

See the complete example at "multiSessions" for an example that establishes multiple server sessions, each with its own transaction context.




Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index