|
|
| Author |
Message |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
Friends,
I am facing a strange issue related to a Online transaction and Batch job.
I have one CICS online transaction XXXX which process a set of message received from other system. When this transaction runs I write all the messages into a table by splitting up the message into two halves.
When this CICS transaction is running, some batch job kicks off and writes into the same table.
My problem lies with that online transaction. Since I split that record into half and write into table, and when the batch job comes in, my records from XXXX does not go consecutively into that table and I am facing problem.
I thought of having some control table to be common between these two. Batch jobs update this control value to 'NO' during start and 'YES' at the end. And check that value in XXXX for 'YES' at starting to continue processing. If its 'NO' delay this XXXX for some 30 seconds.
But the difficulty here is when XXXX is running and batch jobs come at middle though the control table will be updated, XXXX will continue to run until that unit of work is completed. So this may again disrupt my records into the table.
Any suggestion to overcome this and interlock the Batch job and CICS transaction.
Hope I am clear with my requirement. I would be pleased to provide more info if needed. |
|
| Back to top |
|
 |
References
|
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1673 Location: germany
|
|
|
|
Is this your problem:
| Quote: |
my records from XXXX does not go consecutively into that table
|
or
Is it the 'scheduling/triggering' of the batch job, the problem?
what triggers the batch job? |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
Dick,
My problem is with records not going to table consecutively. (i.e two halves should come as consecutive records)
The batch jobs is triggered by some other system, and hence I cannot have any control over the scheduling of that job. |
|
| Back to top |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 192 Location: Dublin, Ireland
|
|
|
|
The problem is most likely the sharing of the file by both CICS and batch simultaneously. Usually batch applications have the file closed to CICS access CICS?
Garry. |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
Garry,
I am NOT trying to share a file. The problem is since both CICS & BATCH tries to write into the same table, I am having problem.
Btw, table level/ROW level lock is also ruled out since, the batch job may abend due to contention. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1673 Location: germany
|
|
|
|
are we talking about 2 records in a vsam file
or
two rows on a db2 table? |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
Dick,
I am concerned about two rows on a DB2 table. |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1027 Location: Virginia, USA
|
|
|
|
| There is no such thing as consecutive records in a DB2 table. Add a timestamp to the records then get the current timestamp when you insert a row use the that timestamp, when you insert 2 rows use the same timestamp for both rows. |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
Craq,
Exactly said.. (you should have sneaked into my application )
I am using a timestamp row and I insert the current system time along with the message. I referred this consecutive rows. Apologize for this confusion.
My table index does not allow me to use same timestamp for two rows.
I am looking for some kind of CICS/BATCH application control. Some kind of technique/tool to make both of these run without any issues. |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1027 Location: Virginia, USA
|
|
|
|
| Add a sequence and change the table index to use timestamp & sequence. |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
The CICS transaction XXXX is some kind of receiver program (just receives the message and store in some table)
If I am going to add a sequence number column, I may need to change the processor program and also adding a new column requires complex procedures in my system. My boss won't allow me that
I would prefer to make any changes via COBOL code without affecting the existing table/index setup. Sounds crazy, but it happens to be like this for me  |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1673 Location: germany
|
|
|
|
how often can transaction XXXX be fired off for two seeminly simulataneous tasks?
before you insert, set a host variable to current_timestamp.
set the milliseconds to zero,
INSERT first half using the host variable as source for your TS column,
add 1 millisecond to host_TS,
INSERT second.
If you ever have to go to a third row, no problem. |
|
| Back to top |
|
 |
Garry Carroll
Active User
Joined: 08 May 2006 Posts: 192 Location: Dublin, Ireland
|
|
|
|
If transaction XXXX is receiving "messages" can the batch program apply its messages via the same route - and thus let CICS be the sole point of contact with the DB2 table? This way, CICS would split and apply your messages before seeing a next message from anywhere.
Just a thought....
Garry. |
|
| Back to top |
|
 |
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 240
|
|
|
|
suggest you review vendor software that will allow your batch cobol
program to logically control communications with CICS region.
in other words , send you batch update requests into CICS
and let a new or existing CICS application perform the updates.
look at www.batchcics.connect |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 79 Location: Chennai
|
|
|
|
Dick,
My Transaction runs almost runs for every 10 seconds each time. XXXX will keep running but not continuously in one stretch. It will run in separate unit of work.
Adding 1 microsecond delay seems to be good idea.. We already thought on this solution. But then we do not want to manipulate the timestamp which is against coding standard in my system.. Let me consult with my colleagues to see if I can get any exception..
Thanks a lot..
Garry,
Your solution may need a code change on sender side also. I mean the sending system (triggering job) has to make change to send messages via MQ and not via batch. This may not be advisable from sender perspective. But worth a thought. Let me keep it as last option.
Earl,
Let me escalate this.
Thank you all for your great thoughts. |
|
| Back to top |
|
 |
|
|