popeye
12th June 2002, 00:40
Hi,
I am using Function Servers for deleting PO lines.
It works fine whenever I delete couple of PO lines.

Whenever I try to delete lots of 'em (2000), it gives me a Fatal Error.
Please see the attached pic for the error.

Why is this happening?
Thanks.
Regards,
Popeye

OmeLuuk
12th June 2002, 14:02
Could be anything... Do you use SESSION_TIMEOUT? What is in the LOG-files ($BSE/log or eventvwr)? Did your database log anything? How long does it run before it collapses? Are you committing every once in a while?

mark_h
12th June 2002, 18:35
Do you get this timeout when only running this function server? If you get timeouts during the day then see the current post in the tools administration area.

Another question is how do you run the function server? Do you find a po, delete some lines, then find the next po. Or do you find a po, delete some lines, then close the sessions, then get the next po. It maybe that after deleting the lines for each PO you need to close the sessions. I can not remember which FS I did where I had problems when I did not close the session before processing the next record. Just a thought!

Good Luck!

Mark

popeye
12th June 2002, 19:51
Mark,
I get the timeout only with this function server.
I delete the reqd lines of the PO, then close the session.
Pick up the next PO ... etc.

Thanks for your posts.
Cheers,
Popeye!

popeye
12th June 2002, 19:54
OmeLuuk,
How do I use SESSION_TIMEOUT?
I am commiting after every PO.
It runs for 1/2 hr before it collapes.
Popeye!

OmeLuuk
13th June 2002, 11:16
SESSION_TIMEOUT is a setting that can be set in the $BSE/lib/defaults/all file
It also can be set in the $BSE/lib/defaults/bshell_name file if you use different bshell names within your company.
In these files the syntax should be like:
SESSION_TIMEOUT:72000

It may also be set from the bw client (in the command box like in "-- -set SESSION_TIMEOUT=72000") or from the Unix command line.

SESSION_TIMEOUT is the time that a bshell process (on the server) may be active without interaction with the client side, measured in seconds. Read the solutions on the knowledgebase for more info, search for SESSION_TIMEOUT.

BTW, what about the other questions?

Al Smith
13th June 2002, 15:45
Hi,
Is this being run through Baan's automation object?
e.g. VB or Excel VBA.

If so, try putting a DoEvents after each PO update.
Al.

popeye
13th June 2002, 23:27
Hi,
Here are the contents of the log files
log.reply_handler
02-13-06[13:17:28](pid=4): Request Queue Exited --- Exiting
02-13-06[13:17:46](pid=4): Logging pttstpcsmqreply1, Version: 1.1.0

log.licd6.1
2002-06-13[13:19:15]:I:root: ******* S T A R T of Information message *******
2002-06-13[13:19:15]:I:root: Log message called from /port.6.1c.06.02/vobs/tt/li
cence/licd.c: #1006 keyword: licd
2002-06-13[13:19:15]:I:root: Pid 12652 Uid 0 Euid 0 Gid 1 Egid 1
2002-06-13[13:19:15]:I:root: user_type S language 2 user_name root tty locale I
SO88591/NULL
2002-06-13[13:19:15]:I:root: Errno 0 bdb_errno 0
2002-06-13[13:19:15]:I:root: Log_mesg: unregistered baanrd:mnair.15368
2002-06-13[13:19:15]:I:root: ******* E N D of Information message *******

log.bshell6.1

2002-06-13[13:19:20]:E:mnair100: ******* S T A R T of Error message *******
2002-06-13[13:19:20]:E:mnair100: Log message called from /port.6.1c.06.02/vobs/t
t/lib/al_1/al_sig.c: #152 keyword: CORE DUMPED
2002-06-13[13:19:20]:E:mnair100: Pid 15368 Uid 6444 Euid 6444 Gid 125 Egid 125
2002-06-13[13:19:20]:E:mnair100: user_type S language 2 user_name mnair100 tty o
te locale ISO88591/NULL
2002-06-13[13:19:20]:E:mnair100: Errno 0 bdb_errno 509 (Bad memory cursor; bad t
able pointer specified)
2002-06-13[13:19:20]:E:mnair100: Log_mesg: core_dumped() signal 11 cwd: '/home/m
nair'
2002-06-13[13:19:20]:E:mnair100: ******* E N D of Error message *******

log.request_handler
02-13-06[13:17:46](pid=1): Logging pttstpcsmqreqst1, Version: 1.1.0

log.timeout_handler
02-13-06[13:17:46](pid=5): Logging pttstpcsmqtime0, Version: 1.1.0

lbencic
14th June 2002, 00:34
One suggestion is to try playing with opening and closing your session (stpapi.session.end) placement.

Some people have found that if they close the session after each transaction, they have slower performance, but higher reliability.

For us, we found that ending the session each time caused us problems, and we faired better to leave it open untill all processing was done.

Maybe if you post all or portions of your script, we can help better make suggestions. Also, the questions of how this is running (is it through BAS?, VB? etc) are relevant.

popeye
14th June 2002, 00:40
Hi,
I am calling the Function Server thru a Baan Script.
Here is the code (DLL func).

function extern domain tcbool tdpurodll00001.delete.po.line(domain tcorno hold.orno,
domain tcpono hold.pono,
ref domain tcmcs.str100 hold.error)
{

long ret
domain tcorno tmp.orno
domain tcpono tmp.pono

hold.error = ""
hold.fs.orno = hold.orno

| Setting default answers ...

stpapi.enum.answer("tdpur4105s001", "ttstpq0100", ttyeno.yes)
stpapi.enum.answer("tdpur4105s001", "tdpur1001.o", ttyeno.yes)
stpapi.handle.subproc("tdpur4105s001","tdpur5106s000","kill")

f4105s001.put.Purchase_Order(hold.orno)
f4105s001.put.Position_Number(hold.pono)
ret = f4105s001.find()
if ret = 1 then
tmp.orno = f4105s001.get.Purchase_Order()
tmp.pono = f4105s001.get.Position_Number()
if hold.orno = tmp.orno and
hold.pono = tmp.pono then
f4105s001.delete(1, hold.error)
if not isspace(hold.error) then
f4105s001.end()
return(FALSE)
endif
f4105s001.end()
return(TRUE)
endif
hold.error = "Function Server did not pick the correct rec."
f4105s001.end()
return(FALSE)
else
hold.error = "Purchase Order Line not found"
f4105s001.end()
return(FALSE)
endif
}

lbencic
14th June 2002, 00:48
Are there any normal errors that you get?

Baan suggests putting a 'recover' command after any failed updates, including the delete, prior to the end. Not sure of the create dll way to call that, but it is the command 'stpapi.recover(...)', and executes the choice.recover.set section.

popeye
14th June 2002, 00:57
Hi Lisa,
The only other error I get is that the Function Server sometimes
does not pick the correct record (find command goes for a toss).
Hence the section related to "Function Server did not pick the
correct rec."


tmp.orno = f4105s001.get.Purchase_Order()
tmp.pono = f4105s001.get.Position_Number()
if hold.orno = tmp.orno and
hold.pono = tmp.pono then


There are couple of threads on the above topic.
The Session throws the fatal error (Connection with Server
Lost) only when I try to process a lot of recs at the same time
(2000 +). This again does not happen all the time :(

Thanks.
Popeye!

mark_h
14th June 2002, 04:40
Which database are you using? Is there a database error also?

I searched the support web site for the 509 error and according to Baan there should be another bshell error before the one you posted that shows what was actually running when in got the 509 error. Baan basically says alot of things can cause 509 errors. I thought there was a post on the board about that, but I could not find it.

Lisa is correct about the stpapi.recover command. In one FS I had to use it when I got an error inserting records. If I did not call stpapi.recover the next record was corrupted and the session would not end correctly. Unless you are getting a lot of delete errors I would not think this is related to your problem.

Good Luck!

Mark