NonStop Systems Introduction
Transaction Management
NonStop Systems Introduction—527825-001
5-16
TMF Integration With the Application Server
Environments and SQL/MX
Figure 5-8. NonStop Application Environment: TS/MP, SQL/MX, and TMF
Send
requests
Return
replies
Update
data
Select
data
Microsoft Windows program
with NonStop Tuxedo
ATMI calls
C program with
embedded SQL statements
Business data
Data dictionary
Server
program
/* Begin Transaction */
tpbegin(. . .)
. . .
Display dialog box
Accept data to update database:bonus
rate, low salary, high salary
. . .
/* Send message to server */
Process reply_messages
. . .
/* End Transaction */
tpcommit(. . .)
. . .
. . .
EXEC SQL DECLARE salary_bonus
CURSOR FOR
SELECT empnum, salary
FROM employee
WHERE salary BETWEEN
:num_low AND :num_high
FOR UPDATE OF salary;
. . .
Receive msg.bonus, msg.high-sal, msg.low_sal
Send reply
. . .
num_low = msg.low_sal;
num_high = msg.high_sal;
EXEC SQL OPEN salary_bonus;
. . .
EXEC SQL FETCH salary_bonus
INTO:emp.empnum, :emp.salary;
. . .
EXEC SQL UPDATE employee
SET salary=salary+(salary*msg.bonus_rate)
WHERE CURRENT OF CURSOR salary_bonus;
. . .
Branch back to fetch next row
. . .
EXEC SQL CLOSE salary_bonus;
. . .
Accept/display data
Client
program
Bonus Rate:
Salary Range
High:
Low:
OK Cancel
Update Salary
VST063.vsd
tpcall(. . .)