Initializing the Java Transaction Service

JTS needs to be instantiated, set as the transaction service of the ORB, and recovered before it can be used to create and manage transactions. The instantiation and setting as the transaction service can be done in two ways:

With properties file

The ORB looks in the transactions.properties file for the default transaction service at stratup. It will instantiate an object of the class specified in that file, and call its initialize method. By default, this file conatins the following property:

#
# Transaction Service Properties
#

# the class name of the transaction service
transaction.service.class=com.sssw.jts.api.TransactionService

The transactions.properties file can be found in the following location:

During iniatialization JTS will publish itself and can be resolved as "TransactionService".

Example Server initialization with properties file

Programatically

You can programmatically instantiate JTS and set it as the transaction service using the ORB TSIdentification API interface object. You must make sure that the transactions.properties does not specify any class as the transaction service.

Example Server initialization programmatically



Copyright © 2003, 2004 Novell, Inc. All rights reserved. Copyright © 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.