Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th December 2011, 22:51
jp.aalders's Avatar
jp.aalders jp.aalders is offline
Senior Member
 
Join Date: Aug 2001
Location: Ootmarsum - The Netherlands
Posts: 164
jp.aalders is on a distinguished road
Baan: Baan c4 - DB: Oracle, Bisam, Informix - OS: AIX, HP-UX, Suse
AFS waiting timed out (frozen)

Hi fellow Baan programmers,

Who has a clue why my AFS function gets frozen and doesn't finish?

I currently try to develop a AFS session in tpptc1100m000 to update the status of an element from "free" to "actual". When saving the changed record the session calls the subsession tpptc1102s000 after the message tpptc11001 has been answered with "yes".

This routine is handled with the AFS code below but the session hangs when the continue.process is executed. The AFS log states...

>tpptc1100m000 handle.subproc tpptc1102s000 add
81dll->serv (handle.subsession^Atpptc1102s000^A2^A84)
>tpptc1102s000(85) put.field:cspp 1
>tpptc1102s000(85) put.field:step.size 1
>tpptc1100m000 continue.process
tpptc1100m000waiting for prev cont.proc
tpptc1100m000waiting timed out
81dll->serv (cont.process^A84)

----------------------- AFS function used -------------------------------


function status.structuurdeel()
{
string st_sessie(13) |* AFS session
string subsession(13) |* AFS subsession
string afs.mess(100) |* AFS messages
string errtype(100) |* AFS messages
string errmess(100) |* AFS messages
string afs.error(100) |* AFS messages
domain tccprj ret.cprj
domain tppdm.cspa ret.cspa
domain tccprj i.cprj
domain tppdm.cspa i.cspa
domain tppdm.cspa top.cspa

|* Functie initialisation
i.cprj = "A06045" |* Sample
i.cspa = " 15" |* Sample
top.cspa = " 1" |* Sampe

|* Answer the message tpptc11001 with yes
ret = stpapi.enum.answer(st_sessie,"tpptc11001",tppdm.yeno.yes)

st_sessie = "tpptc1100m000" |* Main session
subsession = "tpptc1102s000" |* Sub session

|* Search record ( project / element )
stpapi.put.field(st_sessie,"tpptc100.cprj",i.cprj)
stpapi.put.field(st_sessie,"tpptc100.cspa",i.cspa)
ret = stpapi.find(st_sessie, afs.mess)

|* Read values found
stpapi.get.field(st_sessie,"tpptc100.cprj",ret.cprj)
stpapi.get.field(st_sessie,"tpptc100.cspa",ret.cspa)


stpapi.put.field(st_sessie,"tpptc100.stat", str$(tpptc.stat.actual))
ret = stpapi.update(st_sessie ,true, afs.error)

|

|* Recover record indien AFS mislukt.
if not ret then
ret = stpapi.recover(st_sessie, afs.error)
endif

|* Subsession tpptc1102s000 is started
stpapi.handle.subproc(st_sessie,subsession,"add")

|* Set values
stpapi.put.field(subsession,"cspp",top.cspa)
stpapi.put.field(subsession,"step.size", "1")

|* Continue process
stpapi.continue.process(st_sessie,afs.mess)

|* End subsession and and main session
stpapi.end.session(subsession)
stpapi.end.session(st_sessie)
}

Thanks for your assistance in advance! regards John
Reply With Quote
  #2  
Old 20th December 2011, 14:16
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Okay - the first thing I saw was the stpapi.handle.subproc. It should be set before the subsession is activated. My tpptc1100m000 does not zoom to a sub-session when I change that field so I can't really test it.
Code:
function status.structuurdeel()
{
        string  st_sessie(13)                  |* AFS session
        string  subsession(13)                |* AFS subsession
        string  afs.mess(100)                 |* AFS messages
        string  errtype(100)                   |* AFS messages
        string  errmess(100)                  |* AFS messages
        string  afs.error(100)                 |* AFS messages
        domain  tccprj  ret.cprj
        domain  tppdm.cspa ret.cspa
        domain  tccprj  i.cprj
        domain  tppdm.cspa i.cspa
        domain  tppdm.cspa top.cspa

        |* Functie initialisation
        i.cprj = "A06045"        |* Sample
        i.cspa   = "      15"     |* Sample
        top.cspa = "       1"    |* Sampe
     
       |* Answer the message tpptc11001 with yes
        ret = stpapi.enum.answer(st_sessie,"tpptc11001",tppdm.yeno.yes)

        st_sessie  = "tpptc1100m000"    |* Main session
        subsession = "tpptc1102s000"    |* Sub session

        |* Search record ( project / element )
        stpapi.put.field(st_sessie,"tpptc100.cprj",i.cprj)
        stpapi.put.field(st_sessie,"tpptc100.cspa",i.cspa)
        ret = stpapi.find(st_sessie, afs.mess)

        |* Read values found
        stpapi.get.field(st_sessie,"tpptc100.cprj",ret.cprj)
        stpapi.get.field(st_sessie,"tpptc100.cspa",ret.cspa)


        stpapi.put.field(st_sessie,"tpptc100.stat", str$(tpptc.stat.actual))

       |* Subsession tpptc1102s000 is started
        stpapi.handle.subproc(st_sessie,subsession,"add")

        ret = stpapi.update(st_sessie ,true, afs.error)

         |* Recover record indien AFS mislukt.
        if  not  ret then
            ret = stpapi.recover(st_sessie, afs.error)
        endif

        |* Set values 
        stpapi.put.field(subsession,"cspp",top.cspa)
        stpapi.put.field(subsession,"step.size", "1")

        |* Continue process
        stpapi.continue.process(st_sessie,afs.mess)

        |* End subsession and and main session
        stpapi.end.session(subsession)
        stpapi.end.session(st_sessie)
}
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 20th December 2011, 19:39
jp.aalders's Avatar
jp.aalders jp.aalders is offline
Senior Member
 
Join Date: Aug 2001
Location: Ootmarsum - The Netherlands
Posts: 164
jp.aalders is on a distinguished road
Baan: Baan c4 - DB: Oracle, Bisam, Informix - OS: AIX, HP-UX, Suse


stupid... sometimes you just stare too long at your code....
The problem was caused by myself,

|* Set values
stpapi.put.field(subsession,"cspp",top.cspa)
stpapi.put.field(subsession,"step.size", "1")


|* Continue process
stpapi.continue.process(st_sessie,afs.mess)

The continue.process was not executed for the subsession but for the main session. I changed the continue.process to the subsession and now it's running fine.

Thanks for the support & time!

John
Reply With Quote
Sponsored Links
  #4  
Old 20th December 2011, 20:08
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Glad you solved it. I was just getting ready to post if I used your code up to the update it worked for me. Then again I did not have the subsession so did not catch that.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 20th December 2011, 20:48
jp.aalders's Avatar
jp.aalders jp.aalders is offline
Senior Member
 
Join Date: Aug 2001
Location: Ootmarsum - The Netherlands
Posts: 164
jp.aalders is on a distinguished road
Baan: Baan c4 - DB: Oracle, Bisam, Informix - OS: AIX, HP-UX, Suse
Quote:
Originally Posted by mark_h View Post
Glad you solved it. I was just getting ready to post if I used your code up to the update it worked for me. Then again I did not have the subsession so did not catch that.
Thanks for your effort Marc, good to have communities like these :-)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AFS "Hangs" Waiting for device option sharma AFS/DDC/OLE: Function servers 9 25th July 2011 10:46
Steps to create AFS indian_sumesh AFS/DDC/OLE: Function servers 1 6th November 2008 17:32
AFS "hangs" waiting any value baanfans AFS/DDC/OLE: Function servers 3 18th July 2006 16:56
AFS (tfgld1101m000) don´t run fine since a user with a Dynamic menu (DEM) garias AFS/DDC/OLE: Function servers 4 20th January 2004 14:24
Requir help in AFS - tfgld1101m000 learner AFS/DDC/OLE: Function servers 4 3rd January 2004 08:36


All times are GMT +2. The time now is 03:20.


©2001-2017 - Baanboard.com - Baanforums.com