arunprasath
29th November 2002, 16:23
Hi,
I am running Maintain Transactions (tfgld1101m000) session through AFS.

From Maintain Transactions, second Session is tfacr1110s000 and from this third session is tfacr1111s000.

I am reading from an ASCII file and running the 3 sessions in a loop.
I am closing all the sessions and opening them again within the loop.

Now the problem is when I give a huge amount of data in the ASCII file, after execution of approximately 475 records, I am getting a Fatal error.

Fatal Error: Error base_extern api.messages not found in process 2214
Fatal Error: Can not continue in tfacrsession in DLL: ottstpapihand().

Has anybody experienced this error.
There is no problem with the input data as I have checked loading them separately. I have the loaded the latest solution 10923.
Please help
thanks in advance.
s.arun prasath

mark_h
29th November 2002, 16:54
Well I have never seen this error and some of my function servers load 1000's of records. I can only make a couple of guesses here. First are there any other processes that may be hanging around that are not mentioned? Maybe another process that needs to be killed.

I see that you check the records individually, but what about checking a 5 or 6 records around the record causing the error. Maybe it is a combination of these.

I know this is not much help, but it is all I can think of - short of calling Baan support.

Mark

arunprasath
29th November 2002, 17:25
Thanks mark for the reply.

There are no other processes apart from these three sessions that are running.
And I have checked nearly 100 of records around this error causing record(s). But that are also working fine.
That shows there is no error in the input record.

The error comes only after processing 475 records(approx).

The error message that comes from baan doesnt give any idea of where the error might be.
This error is strange.
pls help
s.arun prasath

mark_h
29th November 2002, 17:56
I went and checked Baan support and did not find anything. It almost looks like after so long the api code just decides to quit working. I do not have a clue as to how to get around this without Baan support.

Mark

rohan_rege
2nd December 2002, 18:20
Hi Arun,
With regards to the Error message you are getting, i.e

Fatal Error: Error base_extern api.messages not found in process 2214
Fatal Error: Can not continue in tfacrsession in DLL: ottstpapihand().


I used to get similar messages , in the following case :

Imagine session A calls session B , Now after some processing in session B , commands for closing session B are executed, though ur program logic assumes session B is closed and tries to use stpapi commands in session A ,sometimes session B is still open due to programmatic error or due to some case u didnt take care of .

Basically ur the AFS program executes the wrong stpapi command at the wrong session which shud have been closed but didnt bcoz u didnt consider a case in the program or the data inthe ASCII file lead it to the above case.

These are the cases I encountered such errors with.

I dont really know if the same applies to you , but u can just give it a try , by testing ur program for 4 or 5 reocrds at a time instead of running all the 400+ records at one time ..
Infact as Mark said , check aroung 5 or 6 records before the error occurs....infact taking those last 10-15 will also not take a long time...

This way u will know on which record did the error occur.

While debugging these records just see which Sessions are open at each Step in the program...

U will get the error at a particular point , where u can then check whether the sessions u expected are up or are there any extra session still up and current.

Just let me know if this did help....or if u have already tried and the sessions are opening correctly.


Rgds
Rohan

arunprasath
3rd December 2002, 15:21
Thanks Rohan for your reply.

There is no possibility that I am not closing the session. because, my code works for records < 470(approx).
I also selected records from 450 to 550 (i.e., around the error causing records)and executed them separately and they ran smoothly without any errors.

The things I have noticed today will give some idea I suppose.

What I do is I create a single batch number in Maintain Transactions and each time, I am finding for the batch number and then inserting records into the next subsessions.

so as the number of records go more and more in the next subsessions, the speed of the closing the session is becoming slower and slower.

So when I see in Debug mode, it takes more time to execute the line
1.stpapi.end.session("tfacr1110s000")
2.stpapi.end.session("tfgld1101m000")
In my code, I get the error after execution of the line 2.
Manually also when we close this session after such huge data, it is taking long time to come back to the main session.

so what I feel is that there is an internal API memory allocation problem. I might be wrong.

arunprasath
3rd December 2002, 15:36
Today I checked running Maintain Transactions with different subsessions.
Here, I have Maintain Bank Transactions as my next subsession. (tfcmg2100s000).

so now there is only two sessions.
1.tfgld1101m000 - > tfcmg2100s000

Here also I open these two sessions and close them inside a loop.

I again tested with more records.
But today also It failed after processing 475 records.
This is strange.

The last 2 lines of my AFS code is

1.stpapi.end.session("tfcmg2100s000")
2.stpapi.end.session("tfgld1101m000")

Situation is same as my previous post.
I am getting error after executing last line. (i.e.,stpapi.end.session("tfgld1101m000")
Here also I have noticed that, closing the session takes time as the number of records increase.
so this makes me think that this is again internal memory problem.
Baan support is of no use..

mark_h
3rd December 2002, 17:29
Yes - I think you are right about it being internal memory. The question I have is it possible that you limit how many records you run through tfgld1101m000? I do not know enough about the sessions, but from your post it sounds like you open up tfgld1101m000 and then process 475 transactions, before closing tfgld1101m000. I know you should not have to limit the transactions, but it may mean that you have more batches(?? -just guessing) with fewer transactions, but it allows the function server to run.

And I agree about Baan support - they need someone that is proficient at both the sessions and function server code. The couple of times I called they really did not help at all. I have been lucky so far on needing to call them.

Mark

rohan_rege
3rd December 2002, 17:51
Hi Arun,

From what I understand of ur problem now is that , ur second session takes longer to end after u execute the stpapi.end.session for it ........


The program executes the stpapi.end.session for ur second session and assuming it has already been closed it moves on to execute stpapi.end.session for tfgld1101m000....

It hangs because the second session is still open as it is taking longer to close

Try giving the second session some time to close by putting the foll. command between the two stpapi.end.session's

i.e try the following ....infact u can put the delay only when the no of records is greater than 470


stpapi.end.session("tfcmg2100s000")

if record.count > 470 then
ret=shell("sleep 1" ,SHELL_NO_OUTPUT)
endif

stpapi.end.session("tfgld1101m000")

please let me know if i have understood ur prob correctly and if yes then try the above.

i tried it in my prog for the same ..it works..... :-)


Rgds
Jai Gurudeva
Rohan Rege

arunprasath
5th December 2002, 15:39
Thanks Mark and Rohan for your reply.

Mark, Yes, I can restrict the number of records in the file.
so I can restrict the number of records. that is one workaround.
In that case, I would be creating more number of batch numbers. That is not a problem. So there is a work around.

and Rohan, I have tried ur idea.
I have added the line suspend(1000) between the two stpapi.end.session().

Now some good news. I am able to process more number of records.But I get error after some time. after processing 609 records.
that means, the break between two sessions helps.
I dont know if I increase the break between two stpapi.end's the number of records processed will be more.

anyhow.. after much struggles and discoveries with of course with your suggestions, I could do something with AFS.