For Programmers: Free Programming Magazines  


Home > Archive > Cobol > March 2004 > Cobol and Java communication









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Cobol and Java communication
Da LoU

2004-03-26, 10:59 pm

Hi,

I'm using Linux, Server Express 2.2 and sun j2se 1.4.1

I'd like to make these two processes communicate :
process A is a java application
process B is a cobol application

I start A using cobjrun.
Then A starts 2 threads. I'll call them A1 and A2.
A2 calls B and waits for B to finish executing.

A1 is still running.

I want to communicate data betweed A1 and B while B is running

What's the best way to do it ?

To illustrate my problem, below is the output of A1, A2 and B. Today
the communication is not working. I want to communicate the content of
the variable a. For A1 and A2, a is a global variable.
I call B (cobol) from A2 passing a to B by reference.
B and A1 run in parallel.

My problem is that a is not updated in A1 as B increments its value.
I have to wait for B to finish its execcution before a is updated in
A1.

A1: a=1
A1: a=1
A2: a= 1
A1: a=1
B: a=+0000000001
B: a=+0000000001
B: a=+0000000002
B: a=+0000000003
A1: a=1
B: a=+0000000004
A1: a=1
B: a=+0000000005
B: a=+0000000006
A1: a=1
B: a=+0000000007
A1: a=1
B: a=+0000000008
A1: a=1
B: a=+0000000009
B: a=+0000000010
A1: a=1
B: a=+0000000011
A2: a= 12
A1: a=12
A1: a=12
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com