www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Using Virtuoso with Tuxedo

Building the Transaction Manager Server
Configuration
Services
Introduction VQL functions Services concept OPENINFO
Clients
Service example

21.3. Services

21.3.1. Introduction

The services (in the Tuxedo's term) are special programs which implement business logic. The services could be in the context of a global XA transaction, in this case 2PC control will be set in motion. Each service which uses Virtuoso as resource manager has hdbc connection to the Virtuoso server. This connection is automatically opened when service activated. The connection string (OPENINFO) to the Virtuoso server is the connection string of the group of the service (see GROUPS section in the sample config file). The OPENINFO has the following format: "Virtuoso:user:password@NODENAME:port". The user,password and port are optional.


21.3.2. VQL functions

VQL functions are used to receive access to hdbc for further work with the Virtuoso server. Only HDBCs received by the VQL functions are operated in the context of the distributed transactions.

int vql_get_connection (HDBC * hdbc, int type); returns result of setting hdbc to current hdbc connection. "type" argument indicates which hdbc is to select, currently only VQL_CTX_TYPE is supported, other values are reserved.

int vql_get_env (HENV * env); returns result of setting current ODBC environment.

Header: vql_client.h

Library: libvirtxa.a


21.3.3. Services concept

Each service has an entry point (some function), which is supposed to perform the application task. The result of whole transaction depends on result of the service's entry function. The scenario of typical workflow is as follows:

The tx_* functions also could be used, See TUXEDO TxRPC related or ORACLE XA documentation.

Services can be built with the following command: buildserver -v -f virt_service1.o -o VirtService1 -r Virtuoso -s VService1 where "virt_service1.o" is the service object file which contains VService1 entry function. "-r Virtuoso" indicates that service must be assembled with Virtuoso XA support library.


21.3.4. OPENINFO

OPENINFO is necessary for services to connect to the certain Virtuoso server. OPENINFO for the services (see GROUPS section in the example) consists of 2 parts: "Virtuoso" term and connection string. Connection string provides the service name, password, server and port of Virtuoso server. Common format of connection string is [USER[:PASSWORD]]@SERVER[:PORT]. Only the SERVER name is required, the others are optional.