473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SQLCODE -817

ALL:

I have created a INSERT trigger on table A in subsystem X. This AFTER
INSERT trigger will call a COBOL stored procedure, which inturn CONNECTs to
subsystem Y and inserts the same row into table B in subsystem Y.

When I test the trigger using table editor, inserts on table A in subsystem
X gets refelected on to table B on subsystem Y.

But when CICS program INSERTS into table A in subsystem X, the stored
procedure that the trigger calls, returns -817 and does not insert into
table B in subsystem Y. However the record gets inserted into table A in
subsystem X.

Any help to solve the -817 error?

TIA
Nov 12 '05 #1
5 3303
Hello,

the scenario you described is in fact a multisite-update, which requires
each resource manager involved to support a protocol called "two phase
commit". The aim of this protocol is, that all resource managers either
commit or roll back changes to the data they manage to ensure data integrity
("all or nothing at all") . Two phase commit always hase one commit
coordinator (usually the initiating resource manager that must be able to
talk "two phase commit" to all the other participants of the transaction.

In your first case (Table editor), the originating Db2 that fires the
trigger becomes the commit coordinator and the update this trigger initiates
at another DB2 works fine because DB2A and DB2B understand the two pase
commit protocol.

If your transaction starts from CICS, this CICS becomes the commit
coordinator (because it is also a resource manager), but it can communicate
only with the local DB2A. Since this DB2A is not the coordinator, it is not
allowed tocoordinate updates with remote DB2B on behalf of CICS in this
case. (You are not even allowed to issue DB2A COMMITs or ROLLBACKs within a
CICS transaction - remember?).

So if your trigger should work under CICS too, the second DB2B must also be
known and connected to this CICS region - but AFAIK, this is only possible
if all the involved resource manager run under the same instance of the
operating system or within a z/OS Sysplex Cluster in conjunction with z/OS
RRM (Recoverable Resource Manager) as the "global" commit coordinator.

Cheers - Walter SCHNEIDER.
"db2sysc" <db*****@yahoo.com> schrieb im Newsbeitrag
news:69**************************@posting.google.c om...
ALL:

I have created a INSERT trigger on table A in subsystem X. This AFTER
INSERT trigger will call a COBOL stored procedure, which inturn CONNECTs to subsystem Y and inserts the same row into table B in subsystem Y.

When I test the trigger using table editor, inserts on table A in subsystem X gets refelected on to table B on subsystem Y.

But when CICS program INSERTS into table A in subsystem X, the stored
procedure that the trigger calls, returns -817 and does not insert into
table B in subsystem Y. However the record gets inserted into table A in
subsystem X.

Any help to solve the -817 error?

TIA

Nov 12 '05 #2
Hello,

the scenario you described is in fact a multisite-update, which requires
each resource manager involved to support a protocol called "two phase
commit". The aim of this protocol is, that all resource managers either
commit or roll back changes to the data they manage to ensure data integrity
("all or nothing at all") . Two phase commit always hase one commit
coordinator (usually the initiating resource manager that must be able to
talk "two phase commit" to all the other participants of the transaction.

In your first case (Table editor), the originating Db2 that fires the
trigger becomes the commit coordinator and the update this trigger initiates
at another DB2 works fine because DB2A and DB2B understand the two pase
commit protocol.

If your transaction starts from CICS, this CICS becomes the commit
coordinator (because it is also a resource manager), but it can communicate
only with the local DB2A. Since this DB2A is not the coordinator, it is not
allowed tocoordinate updates with remote DB2B on behalf of CICS in this
case. (You are not even allowed to issue DB2A COMMITs or ROLLBACKs within a
CICS transaction - remember?).

So if your trigger should work under CICS too, the second DB2B must also be
known and connected to this CICS region - but AFAIK, this is only possible
if all the involved resource manager run under the same instance of the
operating system...

Cheers - Walter SCHNEIDER.

"db2sysc" <db*****@yahoo.com> schrieb im Newsbeitrag
news:69**************************@posting.google.c om...
ALL:

I have created a INSERT trigger on table A in subsystem X. This AFTER
INSERT trigger will call a COBOL stored procedure, which inturn CONNECTs to subsystem Y and inserts the same row into table B in subsystem Y.

When I test the trigger using table editor, inserts on table A in subsystem X gets refelected on to table B on subsystem Y.

But when CICS program INSERTS into table A in subsystem X, the stored
procedure that the trigger calls, returns -817 and does not insert into
table B in subsystem Y. However the record gets inserted into table A in
subsystem X.

Any help to solve the -817 error?

TIA

Nov 12 '05 #3
Thanks a lot Walter.
"Walter Schneider" <wa**************@telekom.at.nospam> wrote in message news:<41***********************@newsreader02.highw ay.telekom.at>...
Hello,

the scenario you described is in fact a multisite-update, which requires
each resource manager involved to support a protocol called "two phase
commit". The aim of this protocol is, that all resource managers either
commit or roll back changes to the data they manage to ensure data integrity
("all or nothing at all") . Two phase commit always hase one commit
coordinator (usually the initiating resource manager that must be able to
talk "two phase commit" to all the other participants of the transaction.

In your first case (Table editor), the originating Db2 that fires the
trigger becomes the commit coordinator and the update this trigger initiates
at another DB2 works fine because DB2A and DB2B understand the two pase
commit protocol.

If your transaction starts from CICS, this CICS becomes the commit
coordinator (because it is also a resource manager), but it can communicate
only with the local DB2A. Since this DB2A is not the coordinator, it is not
allowed tocoordinate updates with remote DB2B on behalf of CICS in this
case. (You are not even allowed to issue DB2A COMMITs or ROLLBACKs within a
CICS transaction - remember?).

So if your trigger should work under CICS too, the second DB2B must also be
known and connected to this CICS region - but AFAIK, this is only possible
if all the involved resource manager run under the same instance of the
operating system...

Cheers - Walter SCHNEIDER.

"db2sysc" <db*****@yahoo.com> schrieb im Newsbeitrag
news:69**************************@posting.google.c om...
ALL:

I have created a INSERT trigger on table A in subsystem X. This AFTER
INSERT trigger will call a COBOL stored procedure, which inturn CONNECTs

to
subsystem Y and inserts the same row into table B in subsystem Y.

When I test the trigger using table editor, inserts on table A in

subsystem
X gets refelected on to table B on subsystem Y.

But when CICS program INSERTS into table A in subsystem X, the stored
procedure that the trigger calls, returns -817 and does not insert into
table B in subsystem Y. However the record gets inserted into table A in
subsystem X.

Any help to solve the -817 error?

TIA

Nov 12 '05 #4
Walter:

What about issuing a COMMIT in the SP? This way when I connect
Subsystem Y and perform I/U/D on Table B will be commited or
rollback?
"Walter Schneider" <wa**************@telekom.at.nospam> wrote in message news:<41***********************@newsreader02.highw ay.telekom.at>...
Hello,

the scenario you described is in fact a multisite-update, which requires
each resource manager involved to support a protocol called "two phase
commit". The aim of this protocol is, that all resource managers either
commit or roll back changes to the data they manage to ensure data integrity
("all or nothing at all") . Two phase commit always hase one commit
coordinator (usually the initiating resource manager that must be able to
talk "two phase commit" to all the other participants of the transaction.

In your first case (Table editor), the originating Db2 that fires the
trigger becomes the commit coordinator and the update this trigger initiates
at another DB2 works fine because DB2A and DB2B understand the two pase
commit protocol.

If your transaction starts from CICS, this CICS becomes the commit
coordinator (because it is also a resource manager), but it can communicate
only with the local DB2A. Since this DB2A is not the coordinator, it is not
allowed tocoordinate updates with remote DB2B on behalf of CICS in this
case. (You are not even allowed to issue DB2A COMMITs or ROLLBACKs within a
CICS transaction - remember?).

So if your trigger should work under CICS too, the second DB2B must also be
known and connected to this CICS region - but AFAIK, this is only possible
if all the involved resource manager run under the same instance of the
operating system...

Cheers - Walter SCHNEIDER.

"db2sysc" <db*****@yahoo.com> schrieb im Newsbeitrag
news:69**************************@posting.google.c om...
ALL:

I have created a INSERT trigger on table A in subsystem X. This AFTER
INSERT trigger will call a COBOL stored procedure, which inturn CONNECTs

to
subsystem Y and inserts the same row into table B in subsystem Y.

When I test the trigger using table editor, inserts on table A in

subsystem
X gets refelected on to table B on subsystem Y.

But when CICS program INSERTS into table A in subsystem X, the stored
procedure that the trigger calls, returns -817 and does not insert into
table B in subsystem Y. However the record gets inserted into table A in
subsystem X.

Any help to solve the -817 error?

TIA

Nov 12 '05 #5
Hello,

unfortunately, there is the same restriction, as documented in DB2 for z/OS
SQL Reference: :
"The COMMIT statement cannot be used in a stored procedure if the procedure
is in

the calling chain of a user-defined function or a trigger or if the caller
is using a

two-phase commit."

The only solution seems to be, that the remote DB2 will be made known to
your CICS so it can become participant in the two phase commit process.
Another option might be, that CICS and both DB2's use the z/OS Recoverable
Resource Services (RRS) if that is implemented at your site and both DB2's
are running within the same z/OS image or Sysplex Cluster. DB2 has a
dedicated language interface called "DSNRLI" for this purpose, but I don't
know if CICS has this capability too...

Cheers - Walter.

"db2sysc" <db*****@yahoo.com> schrieb im Newsbeitrag
news:69**************************@posting.google.c om...
Walter:

What about issuing a COMMIT in the SP? This way when I connect
Subsystem Y and perform I/U/D on Table B will be commited or
rollback?
"Walter Schneider" <wa**************@telekom.at.nospam> wrote in message

news:<41***********************@newsreader02.highw ay.telekom.at>...
Hello,

the scenario you described is in fact a multisite-update, which requires
each resource manager involved to support a protocol called "two phase
commit". The aim of this protocol is, that all resource managers either
commit or roll back changes to the data they manage to ensure data integrity ("all or nothing at all") . Two phase commit always hase one commit
coordinator (usually the initiating resource manager that must be able to talk "two phase commit" to all the other participants of the transaction.
In your first case (Table editor), the originating Db2 that fires the
trigger becomes the commit coordinator and the update this trigger initiates at another DB2 works fine because DB2A and DB2B understand the two pase
commit protocol.

If your transaction starts from CICS, this CICS becomes the commit
coordinator (because it is also a resource manager), but it can communicate only with the local DB2A. Since this DB2A is not the coordinator, it is not allowed tocoordinate updates with remote DB2B on behalf of CICS in this
case. (You are not even allowed to issue DB2A COMMITs or ROLLBACKs within a CICS transaction - remember?).

So if your trigger should work under CICS too, the second DB2B must also be known and connected to this CICS region - but AFAIK, this is only possible if all the involved resource manager run under the same instance of the
operating system...

Cheers - Walter SCHNEIDER.

"db2sysc" <db*****@yahoo.com> schrieb im Newsbeitrag
news:69**************************@posting.google.c om...
ALL:

I have created a INSERT trigger on table A in subsystem X. This AFTER
INSERT trigger will call a COBOL stored procedure, which inturn CONNECTs
to
subsystem Y and inserts the same row into table B in subsystem Y.

When I test the trigger using table editor, inserts on table A in

subsystem
X gets refelected on to table B on subsystem Y.

But when CICS program INSERTS into table A in subsystem X, the stored
procedure that the trigger calls, returns -817 and does not insert

into table B in subsystem Y. However the record gets inserted into table A in subsystem X.

Any help to solve the -817 error?

TIA

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tborn2b | last post by:
DB2 V 7, Z/OS: I receive an SQLCODE -104 for the following trigger : CREATE TRIGGER TRSERED1 NO CASCADE BEFORE INSERT ON SEMINAR REFERENCING NEW AS ZUGANG
5
by: Jean-Marc Blaise | last post by:
Dear all, Could you explain why some SQL messages do not possess a SQLSTATE ? Why not transmitting the SQLSTATE of the original <sqlcode>, for example if you get a -911 on a RUNSTATS ? ...
3
by: JDPope | last post by:
I have a situation which I cannot get a good lead on how to resolve. One of the applications I support uses the Hibernate software to generate SQL. The app is JAVA with JDBC. In testing the users...
15
by: Twan Kennis | last post by:
Hi, I have a DB2 database on the IBM iSeries platform, on which I created several Stored Procedures with the SQLCODE as a return-parameter. These Stored Procedures are called from a Windows...
2
by: Richard | last post by:
Our web programmer was looking in his application log an found the following error: 2006-08-31 16:33:35,129 ERROR org.hibernate.util.JDBCExceptionReporter - < SQL0723N An error occurred in a...
5
by: misterutterbag | last post by:
Stack trace below. Only happens in WebSphere 6.0. DB2 v 8.2. FP12. Only against 1 database. I have other databases in this database instance, but they don't seem to have this problem. ...
10
by: scoonie999 | last post by:
I'm having a problem that I can't seem to find any solution for online. I'm using a cursor in a cobol program to fetch some data. I know for a fact that the select should return 2 rows. The...
22
by: Sri | last post by:
All Recenetly our shop migrated to DB2 V8 from V7. We are in IBM System Level: z/OS 1.6.1 @ RSU 0702. Processor : IBM 2064-1C7 (z/900) # 1B89 Mode: 64-bit One of my application is facing...
7
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! I was searching through DB2 InfoCenter, but didn't find an answer to my question: When I get an SQLCODE from an SQL command (ADMIN_CMD for example) when I want to know what this code means;...
3
by: lenygold via DBMonster.com | last post by:
Thank you very much SERGE for your help. I found example in Graeme Birchall COOKBOOK wich i think exactly what i need for SQL check in triggers: • User query joins to table function - sends...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.