T.R | Title | User | Personal Name | Date | Lines |
---|
108.1 | | RTOAL2::MAHER | TIER3 simply a better RPC! | Wed Jan 29 1997 10:47 | 183 |
| identification division.
program-id. master_rtn.
data division.
working-storage section.
01 ss$_normal pic s9(9) comp value external ss$_normal.
01 ss$_abort pic s9(9) comp value external ss$_abort.
01 sys_status pic s9(9) comp.
01 db_spec.
03 pic x(20) value "alias pers filename".
03 db_filename pic x(30) value "[.test]mf_personnel".
01 dtm_iosb.
03 dtm_iosb_status pic s9(4) comp.
03 pic xx.
03 reason_code pic s9(9) comp.
01 msg_buf pic x(256).
01 msg_len pic 9(4) comp.
01 sql_ctx.
03 pic 9(9) comp value 1.
03 pic 9(9) comp value 1.
03 pic 9(9) comp value 16.
03 tid pic x(16) value low-values.
03 pic 9(9) comp value zero.
01 bid pic x(16).
*
01 rdb$message_vector external.
03 rdb$lu_num_arguments pic s9(9) comp.
03 rdb$lu_status pic s9(9) comp.
03 rdb$alu_arguments occurs 18 times.
05 rdb$lu_arguments pic s9(9) comp.
*
01 sqlcode pic s9(9) comp.
01 mbx_chan pic 9(4) comp.
01 io$_readvblk pic s9(9) comp value external io$_readvblk.
01 io$_writevblk pic s9(9) comp value external io$_writevblk.
01 letter_sent.
03 ls_tid pic x(16).
03 ls_bid pic x(16).
03 new_name pic x(30).
03 pic x(450).
01 iosb.
03 cond_val pic 9(4) comp.
03 byte_count pic 9(4) comp.
03 chan_info pic 9(9) comp.
01 spawn_flags pic 9(9) comp value 1.
*
procedure division.
kick_off section.
00.
call "sys$crembx"
using by value 0
by reference mbx_chan
by value 512, 512, 0, 0
by descriptor "my_mbx"
by value 0
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
call "lib$spawn"
using by descriptor "$run s"
by value 0, 0
by reference spawn_flags
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
call "declare_connection_name" using sqlcode, db_spec.
if rdb$lu_status not = ss$_normal
call "sys$putmsg" using rdb$message_vector
call "lib$stop" using by value ss$_abort.
perform dist_trans.
stop run.
*
dist_trans section.
00.
display "Enter new department name : " no advancing erase screen.
accept new_name protected reversed at end go to fini.
call "sys$start_transw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid
by value 0, 0
giving sys_status.
if sys_status = ss$_normal move dtm_iosb_status to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
call "sys$add_branchw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid
by descriptor "your_node"
by reference bid
giving sys_status.
if sys_status = ss$_normal move dtm_iosb_status to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
move tid to ls_tid.
move bid to ls_bid.
call "sys$qiow"
using by value 0, mbx_chan, io$_writevblk
by reference iosb
by value 0, 0
by reference letter_sent
by value 512, 0, 0, 0, 0
giving sys_status.
if sys_status = ss$_normal move cond_val to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
perform the_tran.
*+
* Wait until the sub-process has finished its Rdb work.
*-
call "sys$qiow"
using by value 0, mbx_chan, io$_readvblk
by reference iosb
by value 0, 0
by reference letter_sent
by value 512, 0, 0, 0, 0
giving sys_status.
if sys_status = ss$_normal move cond_val to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
if sqlcode = zeros
perform commit_trans
else
perform abort_trans.
*
fini.
*
the_tran section.
00.
call "set_trans_rw" using sqlcode, sql_ctx.
if rdb$lu_status not = ss$_normal
call "sys$putmsg" using rdb$message_vector
call "lib$stop" using by value ss$_abort.
call "update_dept" using sqlcode, new_name, sql_ctx.
if rdb$lu_status not = ss$_normal
call "sys$putmsg" using rdb$message_vector.
*
fini.
*
commit_trans section.
00.
call "sys$end_transw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
if dtm_iosb_status = ss$_abort
call "sys$getmsg"
using by value reason_code
by reference msg_len
by descriptor msg_buf
by value 0,0
giving sys_status
if sys_status not = ss$_normal
call "lib$stop" using by value sys_status
end-if
display "Couldn't commit - " msg_buf (1:msg_len)
else if dtm_iosb_status not = ss$_normal
call "lib$stop" using by value dtm_iosb_status.
*
abort_trans section.
00.
call "sys$abort_transw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid
by value 0
giving sys_status.
if sys_status = ss$_normal or ss$_abort move dtm_iosb_status to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
end program master_rtn.
|
108.2 | | RTOAL2::MAHER | TIER3 simply a better RPC! | Wed Jan 29 1997 10:48 | 158 |
| identification division.
program-id. slave_rtn.
data division.
working-storage section.
01 ss$_normal pic s9(9) comp value external ss$_normal.
01 ss$_abort pic s9(9) comp value external ss$_abort.
01 sys_status pic s9(9) comp.
01 db_spec.
03 pic x(20) value "alias pers filename".
03 db_filename pic x(30) value "[.test]personnel".
01 dtm_iosb.
03 dtm_iosb_status pic s9(4) comp.
03 pic xx.
03 reason_code pic s9(9) comp.
01 msg_buf pic x(256).
01 msg_len pic 9(4) comp.
01 sql_ctx.
03 pic 9(9) comp value 1.
03 pic 9(9) comp value 1.
03 pic 9(9) comp value 16.
03 tid pic x(16) value low-values.
03 pic 9(9) comp value zero.
01 bid pic x(16).
*
01 rdb$message_vector external.
03 rdb$lu_num_arguments pic s9(9) comp.
03 rdb$lu_status pic s9(9) comp.
03 rdb$alu_arguments occurs 18 times.
05 rdb$lu_arguments pic s9(9) comp.
*
01 sqlcode pic s9(9) comp.
01 mbx_chan pic 9(4) comp.
01 io$_readvblk pic s9(9) comp value external io$_readvblk.
01 io$_writevblk pic s9(9) comp value external io$_writevblk.
01 letter_sent.
03 ls_tid pic x(16).
03 ls_bid pic x(16).
03 new_name pic x(30).
03 pic x(450).
01 iosb.
03 cond-val pic 9(4) comp.
03 byte-count pic 9(4) comp.
03 chan-info pic 9(9) comp.
*
procedure division.
kick_off section.
00.
call "sys$assign"
using by descriptor "my_mbx"
by reference mbx_chan
by value 0, 0, 0
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
call "declare_connection_name" using sqlcode, db_spec.
if rdb$lu_status not = ss$_normal
call "sys$putmsg" using rdb$message_vector
call "lib$stop" using by value ss$_abort.
*
perform dist_trans.
stop run.
*
dist_trans section.
00.
call "sys$qiow"
using by value 0, mbx-chan, io$_readvblk
by reference iosb
by value 0, 0
by reference letter-sent
by value 512, 0, 0, 0, 0
giving sys-status.
if sys-status = ss$_normal move cond-val to sys-status.
if sys-status not = ss$_normal call "lib$stop" using by value sys_status.
move ls_tid to tid.
move ls_bid to bid.
call "sys$start_branchw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid
by descriptor "your_node"
by reference bid
by value 0, 0, 0
giving sys_status.
if sys_status = ss$_normal move dtm_iosb_status to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
perform the_update.
*
call "sys$qiow"
using by value 0, mbx_chan, io$_writevblk
by reference iosb
by value 0, 0
by reference letter-sent
by value 512, 0, 0, 0, 0
giving sys-status.
if sys-status = ss$_normal move cond-val to sys-status.
if sys-status not = ss$_normal call "lib$stop" using by value sys_status.
*
fini.
if sqlcode = zeros
perform commit_trans
else perform abort_trans.
*
the_update section.
00.
call "set_trans_rw" using sqlcode, sql_ctx.
if rdb$lu_status not = ss$_normal
call "sys$putmsg" using rdb$message_vector
call "lib$stop" using by value ss$_abort.
call "update_dept" using sqlcode, new_name, sql_ctx.
if rdb$lu_status not = ss$_normal
call "sys$putmsg" using rdb$message_vector.
*
fini.
*
commit_trans section.
00.
call "sys$end_branchw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid, bid
giving sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
if dtm_iosb_status = ss$_abort
call "sys$getmsg"
using by value reason_code
by reference msg_len
by descriptor msg_buf
by value 0,0
giving sys_status
if sys_status not = ss$_normal
call "lib$stop" using by value sys_status
end-if
display "Couldn't commit - " msg_buf (1:msg_len)
else if dtm_iosb_status not = ss$_normal
call "lib$stop" using by value dtm_iosb_status.
*
abort_trans section.
00.
call "sys$abort_transw"
using by value 0, 0
by reference dtm_iosb
by value 0, 0
by reference tid
by value 0
by reference bid
giving sys_status.
if sys_status = ss$_normal or ss$_abort move dtm_iosb_status to sys_status.
if sys_status not = ss$_normal call "lib$stop" using by value sys_status.
*
end program slave_rtn.
|
108.3 | | RTOAL2::MAHER | TIER3 simply a better RPC! | Wed Jan 29 1997 10:49 | 31 |
| module dtm_sql
language cobol
parameter colons
declare global pers alias filename [.test]mf_personnel
procedure declare_connection_name
(
sqlcode,
:db_spec char(50)
);
connect to :db_spec as 'abc';
procedure set_trans_rw
(sqlcode);
set transaction read write;
procedure update_dept
(
sqlcode,
:new_name char(30)
);
update
pers.departments
set
department_name = :new_name
where
department_code = 'SUSA';
|
108.4 | MOVIES::DECDTM-VMS | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Wed Jan 29 1997 13:15 | 11 |
|
OpenVMS simply picks up a saveset from the DECdtm folks and incorporates
it into the distribution -- you'll likely want to check with the DECdtm
folks on this question. MOVIES::DECDTM-VMS.
I'm not familiar with the "branch management services" -- the brief
look at the examples posted in the early replies seem to contain only
documented DECdtm services.
The other package in this area is DECRTR, the reliable transaction router.
|
108.5 | 3 Services - Too much to ask? | EDSD01::MAHER | TIER3 simply a better RPC! | Thu Jan 30 1997 03:39 | 18 |
| Hi,
> I'm not familiar with the "branch management services" -- the brief
> look at the examples posted in the early replies seem to contain only
> documented DECdtm services.
The master_rtn reply makes use of sys$add_branchw and the slave_rtn
uses sys$start_branchw and sys$end_branchw. I've never seen any of
these routines in customer accessible documentation. Although it
would simply be a matter of taking the pages out of the functional
spec and putting them in the SS reference manaual. If you have seen
them documented please let me know where.
> The other package in this area is DECRTR, the reliable transaction router.
You've got to be winding me up!
Regards Richard Maher.
|
108.6 | Ask DECdtm... | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Thu Jan 30 1997 09:38 | 13 |
| : -< 3 Services - Too much to ask? >-
Ask the right folks. As I said, OpenVMS engineering has nothing to
do with the decision to (or not to) document and support the DECdtm
services. (I tried to get the documentation of the recovery/rollback
routine support released a while back...)
: > The other package in this area is DECRTR, the reliable transaction router.
:
: You've got to be winding me up!
No, I'm not. It's a 10 kilogram sledgehammer, but it is documented.
|
108.7 | | MOVIES::POTTER | http://www.vmse.edo.dec.com/~potter/ | Thu Feb 06 1997 09:04 | 31 |
| Ask the right folks. As I said, OpenVMS engineering has nothing to
do with the decision to (or not to) document and support the DECdtm
services. (I tried to get the documentation of the recovery/rollback
routine support released a while back...)
Well, close.
DECdtm _does_ come from OpenVMS engineering, but not from the ZKO office.
However, it is now owned by the sustaining engineering group (if that's the
correct term), and no future development of the product is planned.
As it happens, it's no longer checked in as a saveset, but rather it is checked
in module-by-module, just like any other facility on the masterpack.
I've hurt my head a few times on the brick wall of DECdtm documentation, and I
think that most DECdtm project leaders have done the same. It has just never
seemed like "the right time". Richard and I chatted about this some time
ago, and it prompted another batch of head-butting for me, but as the product
was just about to be transferred to Bryan Jones' group even I could see it was
an inopportune moment to document the additional services.
Maybe someone like Rich Marcello would have the clout to get this work done, I
don't know.
Since I spent about four years working on this product, since I see copies
of loads of glossies describing world-wide mission-critical appications that
run on VMS (stock markets and the like), I'm sure you can guess whether I
would like to see it being documented.
regards,
//alan
|