Skip to content

tuxedo

Day 1 – Tuxedo Training
===========================
RDA = Remote Data Access. Where data access is on client side.
Tuxedo server = some business logic pushed at tuxedo end so the network calls are removed. so performances, time reduced.

TPM = transaction processing monitor – determines which service to cater to – based on user request. centeral processing unit.

TUXEDO = Transactions for UniX Enhanced for Distributed Operations
TPM = Transaction processing monitor – to start, monitor and terminate the transactions = DTP = distributed TP.

Server instances – each instance handles calls to the service
if 2 server instances and svc1 and svc2 then, if call comes then, Srvr1 handling srvr1 then Srvr2 – will handle srvr2.
if more requests come – then – they are put in system Q. FIFO basis – the requests are handled.

Server = has multiple services in it 1 or more.
We can create multiple instances of servers (in which case auto all services defined under it are auto created instance)
or we create multiple instances of services.

-> if same service in multiple servers then the service name has to differ across the servers.
-> if same service in multiple servers then we need to keep them in different group.

Data Dependent Routing: Based on the data the request is forwarded to the right service in the right group.
Definition to be done in UBBConfig.

Application Tx Monitoring Interface = ATMI implemented by Tuxedo.
– Tx Routine, Msg Handling, Svc Interface, Buffer routines.

X/Open = company for standards

Different buffer types: used for data exchange.
1/ String = character array + null character ( it doesnt have null character in b/w) – it is interpreted.
2/ Carray (can have null characters in between – it is not interpreted.
3/ FML (Propreitry product of tuxedo)
4/ View – C Language Structure.

Queue: Request in pipeline – priorty of requests can be defined, a higher priority request will be processed first.
XA:

BBL: Bulletin board = shared memory area – where the servers are up and running. Directory –
– System table = which server has which all services

UBBConfig: Configuration.
System Table – created at run time based on UBBConfig.

Tuxedo libraries
————————-
/T – Core lib
/Q – Q lib
/WS – Workstation listener
/Domain

Communication Calls: Synch – tpcall ,Asynch – tpacall, Conversational – tpconv,tpreply, Stored/Deferred -queues, Unsolicited – broadcast.

When we use the NAME of buffer type – it gets KEY which is the ID from the GLOBAL variable definition.
Then in PRO – C file we include the .h file which has the reference to actual type for given ID.

Practical:
Create UBBConfig, Env, Service,Server,Client

==============================================================
*RESOURCES
IPCKEY = Unique server identifier] 123456 (32000 or above)
MASTER = name of the machine] richie
MODEL = sharememory model] SHM
*MACHINES
richie LMID=FIRST [unique identifier for machine]
TUXDIR=”/tuxedo” [dir having tuxedo lib]
APPDIR=”/home/user” [dir having application svcs]
TUXCONFIG=”/home/user/tuxconfig” [configuration file info]
*GROUPS
GRP1 LMID=FIRST GRPNO=1 [all groups in given machine]

*SERVERS [all services for a given server – clopt can be optional booting time parameters]
simpserv SRVGRP=GRP1 SRVID=1 CLOPT=”-A”

*SERVICES
==============================================================

Runniing first tuxedo program:
1. Create directory – bin,env,src.

No = b/w IPSKEY and value etc.
Simple c program running it.

buildserver -o $MYBIN/server -c server.c
buildclient -o $MYBIN/client -c client.c

Admin commands
=============================
tmadmin
psc
psr

Buffer management routines: tpalloc(), tprealloc(), tpfree()
Join and Leave the Application: tpinit(), tpterm()
Send Buffers to Service Routines, Receive or Cancel Replies: tpcall(), tpacall(), tpgetrply(), tpcancel()
Get or Set Priority for Service Request: tpgprio(), tpsprio()
Establish a Conversation, Send/Receive Conversational Messages, Disconnect a Conversation: tpconnect(), tpsend(), tprecv(), tpdiscon()
Enqueue or Dequeue a Message to/from Stable Storage: tpenqueue() ,tpdequeue()
Error Number and Error Message: tperrno, tpstrerror()

carray – tpalloc — you need to specify the length of array in this — by default no memory size, (Reason is here no null demarcation so need to give size)
view – default 1024 bytes, even if FML.
string – default 512 bytes

We dont need to give length in FML Buffer

SET PRIORITY before tpcall().
================================================
tpsprior( int priority, long flags)
If flag = o, relative priority = so you can set -10, = 40 (By default it is 50)
flag = TPABSOLUTE – then if set to 40, will be between 0 to 100.

tmboot -a? (or only tmboot)
tmshutdown -s servername
tmshutdown -y
tmboot -y

FML – Field Manipulation Language
Structure – to – store the name value details.
Fielded buffer – key/val
seven data types: short,char,long,float,double,STRING,carray.

Day 2 – Tuxedo Training
===========================
mkfldhdr32 abc.tbl – for compilation of tbl file. The field table file
the .h header file generated has the ID also –

This ID is random generation based on [ the sum of var add+ base address ] – and you get some id 16666233 for 4001 so
Use this unique generated ID in header file in global vars.

32 = 32 bits char

File = with extension abc.tbl
Base values 12000
——————-
var1 string 1500
var2 string 1510
var3 string 1520

========================
Environment files:

FIELDTBLS – field table names – files
FIELDTBLDIR – field directory path

Client has global CONST = spfc in .h
Pro C b/s logic has include of .h file
and
.tbl file – is referenced at runtime

==============================================
Cast buffer returned from,tpalloc to FBFR32
FBFR32 – buffer type pointer

FAdd – add data to buffer – it is done in a sequence! No need to manage position,occurrence over here.

FChg = substitute for a given position, if position is missing, then adds the position. if gaps in position then fills in b/w with blank vals.
So chg + Fadd work done. Need to manage occurences = position over here.

FAppend – does not do the indexing before hand.. Just pushes the data in the list. After pushing in, the indexing is done by findex() and
data is retrieved using fget. The usage of this API is when less data is to be sent over network. So do fappend at client side and then
do findex at service level before fget.

buildserver -o fserver -f fserver.c -s FS

gdb fserver core
gdb fclient core
bt =shows where error occurred.

Compile the View file – having the C Structure details etc using . $ implies that line as it is in .h file
here the fbname is mapped to the tbl file.

viewc32 and get the compiled file which is –

VIEW myview
$/*VIEW aud */
#type cname fbname count flag size null
long bid BRANCH_ID 1 – – 0

creates structure aud.
you can fill the structure directly from view at one go!.

VIEWDIR
VIEWFILES
Advantages of views is that – you can – auto dump all data in view from fetch query.

View is exchange data from server to client etc – just like one object.

Complete view data sent over network.
FML only what is set is sent over network.

FML2View – converts fml to view FML structure to c structure.
View2FML – conversts view to buffer ( !! NOT to fml)

==================================
Resources:
Security,AuthSvc,Signal,Dipin,Ignore

Cannot mix servers that are having conversational services and XA services and NON XA Services.

>tmadmin
psc
psr -i

LDBAL – load balancing
security – tmloadcf compilation and authsvc
============

DDR definition will be along with the server name and it is in this way
Server name Field: Field_To_Inspect Routing: ‘id000’:grp_343 etc.

There are commands which allow the tuxconfig to get modified at runtime and using tmunloadcf they can get the UBBCONFIG back.

———————————————-

full WebDAV support

DDR – Summation of the following values:
1. Service name
2. Group Id
3. Field Value

Example of routing….

*SERVICES
TestService1 SRVGRP=GRP_A ROUTING=MID_ROUT_AA
TestService2 SRVGRP=GRP_A ROUTING=MID_ROUT_AA

TestService1 SRVGRP=GRP_B ROUTING=MID_ROUT_AA
TestService2 SRVGRP=GRP_B ROUTING=MID_ROUT_AA

*ROUTING
MID_ROUT_AA FIELD=MID_ROUT_CODE BUFTYPE=”FML32″ RANGES=”‘ABCD’:GRP_A,’GHIJ’:GRP_B”

Routing mandatory needs to use FML for sure, cant use independent views.

ud32 <test.ud
cat test.ud
—————–
n
SRVCNM MULTIPLE
INPUT_DATA 99

Fjoin – updates the value of existing fields and removes extra fields – this is to update buffer with the view.
Only the common elements are removed – and extra in buffer and view are removed

FUpdate – updates buffer val with view value and keeps all extra name values and appends – the buffer with extra view stuff.

tpgetlev() – returns the transaction level – if 1 – it is still going on,0 if done with tx.

———————————–
———————————–
XA and NON-XA Transaction
———————————–
———————————–
What is the difference between tpbegin(), tbcommit() tpabort()
tpopen() and tpclose() – for managing Resources (Could be database,printers?)

If you configure a resource detail in a given group (eg:
MyGrp GrpNo=1
Tnsnames=df tmscount=2
OpenInfo=”……..”

Then automatically – during tpsrvinit() during boot up auto UP the resource manager.
If need to use that from client,
during tpinit() send a parameter with group name – the same groupname that is associated with resource manager.

tpclose() – closes the connection

===================
WSC client -> WSL

WSL -> gets handle to WSH

WSH handle returned to WSC.

MAXWSCLIENTS – maximum wsc for a node…
Default is 0

TuxedoService CLOPT -s @myservicenames.h

here myservicenames keeps the multiple names of the services
for each instance.

OR

write
buildserver
-s NewSvcAdvertiseName1:ActualServiceName\
-s NewSvcAdvertiseName2:ActualServiceName\

==================================
Queue
———-

TMS_QM defined in UBBCONFIG

QMCONFIG – has path of qspace – definition – path to QDevice.

QDEVICE needs to be created – which has the mapping of all the q numbers and q space definition.
Need memory and semaphore to manage it.

ResourceManager – related to QSpace.
QSpace has multiple Q’s.

2 servers provided to
(1) put and get msg from Q.
(2) Fwd msg to service with given buffer

1. Enque,Deque
2. TMForward (fwd)

With every Q – 2 services attached TMForward and and TmQ.
and 1 ResMgr.

QMCONFIG: for configuring Q’s/

Need to associate One Resource Manager with a Q

Q_GRP GRPNO=2
LMID=1
TNSNAMES=TMS_QM
TMSCOUNT=2
OPENINFO= Qpath: QSpacePath

Creating a Queue. Device. 1 Q Space for Q Device.

1. Create QMConfig variable in env.

2. >>>>> qmadmin

3. >>>>> crdl /pathtoQ/QdeviceFile

4. Offset – , size of queue – configurations value for Q Device.

5. This creates a Q Device.

6. >>>>>qspacecreate
Enter name: TNG_QUE
IPC Key: 378950
Size of q space is disk space:
No of q in q space
No of concurrent Tx in Q Space: 10
No of concurrent processes in Q Space: 10
No of max messages in Q space (Sum of all messages in all Q’s) : 100
Error Queue name: ErrQ (if errors messages put in this Q)
Initialize extents: y,n?
Blocking factor: (default 16)

7. >>>>> qopen TRNG_QUE

8. >>>>> qcreate
Q name: ADD_S
Q order: (priority,timeexpiration,fifo,lifo): fifo
Out of ordering enqueing (top, msgid, default=none): msgId (The message id, is passed while enQ and also the logic is
or sequence is stated in programming)
Retry delay in seconds:
% for percent used, m for messages: (Alert time – when used)
Reset low level for Q capacity warning: 0%
Q capacity command: can call script when Q capacity high has been reached.

9. >>>>> qinfo

Can link multiple QSpace with 1 QDevice.
Can have same Q in multiple QSpace.
1 QSpace is linked to 1 Grp and 1 ResMgr and 2 Servers.

For TMForward – the Qname and Service name has to be same,
So all messages to be sent to one service – sent to one Q

One Q has Messages – all of them need to be sent to ONE SERVICE only when using TMForward.
No mixture of messages to be sent to multiple services.

> qspacecreate
Queue space name: MULQ
IPC Key for queue space: 378999
Size of queue space in disk pages: 1000
Number of queues in queue space: 3
Number of concurrent transactions in queue space: 2
Number of concurrent processes in queue space: 2
Number of messages in queue space: 100
Error queue name:
Initialize extents (y, n [default=n]):
Blocking factor [default=16]:

> qopen MULQ

>
qopen MULQ

> qcreate
Queue name: MULQ_Q1
Queue order (priority, time, expiration, fifo, lifo): fifo
Out-of-ordering enqueuing (top, msgid, [default=none]):
Retries [default=0]: 1
Retry delay in seconds [default=0]: 2
High limit for queue capacity warning (b for bytes used, B for blocks used,
% for percent used, m for messages [default=100%]):
Default high threshold: 100%
Reset (low) limit for queue capacity warning [default=0%]:
Default low threshold: 0%
Queue capacity command:
No default queue capacity command
Queue ‘MULQ_Q1’ created

To create the TLOG device
=============================
tmadmin -c
crdl -b 100 /pathto TLOG file

ksh: qadmin: not found
>qmadmin
qmadmin – Copyright (c) 1996-1999 BEA Systems, Inc.
Portions * Copyright 1986-1997 RSA Data Security, Inc.
All Rights Reserved.
Distributed under license by BEA Systems, Inc.
Tuxedo is a registered trademark.
QMCONFIG=/home/tuxtrn/env/queue/tdevice

> v
Verbose mode is now on

> qinfo
Q_CAT:1120: ERROR: Queue space must be opened first

> qopen MULQ

> qinfor

> qinfo
Queue MULQ_Q1: 0 Persistent Messages using 0 pages.
0 Nonpersistent Messages using 0 bytes.
0 Messages in total using 0 bytes.
Queue order: fifo
Out of order: none
Retries: 1
Delay: 2
Default delivery policy: persist
Default expiration time: none
Threshold Triggers:
Persistent: 0 – 100 %, Command:
Non-persistent: 0 – 100 %, Command:

>help
gives list of cmds

1. First create environment variables. TLOGDEVICE,QMCONFIG
2. Create the Q using the commands above.
3. Then create the UBBCONFIG FILE

In Resources section specificy APP_PW – makes the user ask for pwd when compiling ubbconfig.
TPUSR, TPGRP,tpusradd – add user to tux file. tupsrdel,tpusrmod

========================================

Issues with JOLT and their resolution:

never make your session or transaction variables as static but instance level.

Sample Jolt Repository entry is as follows:
==============
SVC/myTestService:
bt=FML32:
ex=1:
BT=FML32:
vs=3
:bp:

pf=167772161:
po=1:
pn=FG_N_CODE:
pa=wr:
pt=string

:ep:bp:

pf=167772162:
po=1:\
pn=PVAR_NAME
pa=wr:
pt=string

:ep:bp:

pf=167772163:
po=1:
pn=FILE_NAME:
pa=wr:
pt=string

%d bloggers like this: