rohan_rege
10th October 2002, 22:19
hi ,

i am facing a very wierd problem...

in my AFS i have written some error handling code....for Unlinking Invoices Lines in tfacp1131s000 session , when they cant be approved and then i delete the Invoice in tfacp1110s000

so to check it , i created some records in my ascii file , so that the Invoice lines dont match and then my program unmatches it and deletes the invoice....


the problem i am facing is that, when i run the program in debug mode , it runs fine..and everything goes on sucessfully , but when i remove debug mode ...and just run it ...it hangs


i have no idea why its behaving like this ?

any ideas ??

Rgds
Rohan

~Vamsi
10th October 2002, 22:27
Rohan,

Look for a parallel process. Something that you are spawning but not waiting for it to complete. When you are in the debug mode, it will work (because it takes time for you to step through each step) but not when compiled normally.

Typically examples you would look for are shell and run.prog where either of them is running in the SHELL_BACKGROUND and RP_NOWAIT mode respectively.

I am sticking my neck out here... I do not belong on this forum :).

mark_h
10th October 2002, 22:35
I have seen this before. The way I found where it was happening was to put messages in the code. I did this until I narrowed it down to which line was causing the problem. In some cases I have put in pauses(sleep 3) to let things catch up or shut down.

Mark

mark_h
10th October 2002, 22:57
I use this in a couple of function servers :
| See if sleeping helps - cause it works in debug
rc = shell("sleep 1",SHELL_NO_OUTPUT)

So far it has always been after I ended a session.(stpapi.end). I do not like this, but it works.


Mark

rohan_rege
10th October 2002, 23:39
hi mark,
It worked .......really gr8...

Thanks a lot once again man........U r a real saviour....:-))

actually the same piece of code is being used in some other place in the program ...but its not causing the same problem there..
I wonder why ?
even then just as a precaution i am adding the sleep in that part of the code too...


Rgds
Rohan Rege