Shared variable xxx has not yet been created. (392)

Posted by James Palmer on 17-Jun-2015 08:50

Ignoring the fact that this is bed practise... sorry Tom et al...

Is there a way of programatically determining if a shared variable has been created yet? I'm trying to write a procedure to tidy up a handle on AppServer disconnect, but not all AppServer procedures NEW the shared var, so I get the errors in the AppServer logs until a NEW has happened. 

Shared variable gv-fes-manager-Handle has not yet been created. (392)

All Replies

Posted by Tim Kuehn on 17-Jun-2015 09:03

ASSIGN local-handle = gv-fes-manager-Handle NO-ERROR. 

If you get an error, then the SV isn't set. 

Tim 

[collapse]
On Wed, Jun 17, 2015 at 9:51 AM, James Palmer <bounce-jdpjamesp@community.progress.com> wrote:
Thread created by James Palmer

Ignoring the fact that this is bed practise... sorry Tom et al...

Is there a way of programatically determining if a shared variable has been created yet? I'm trying to write a procedure to tidy up a handle on AppServer disconnect, but not all AppServer procedures NEW the shared var, so I get the errors in the AppServer logs until a NEW has happened. 

Shared variable gv-fes-manager-Handle has not yet been created. (392)

Stop receiving emails on this subject.

Flag this post as spam/abuse.




--
Tim Kuehn:  Senior Consultant  - TDK Consulting Services
President - Ontario PUG 
Program Committee Chair - PUG Challenge Americas, 
Course Instructor: Intro to OO Concepts for Procedural Programmers

Skype: timothy.kuehn
Ph: 519-576-8100
Cell: 519-781-0081
[/collapse]

Posted by James Palmer on 17-Jun-2015 09:04

Yeah but I'm running the code on the AppServer and that fills up the AppServer logs with errors.

Posted by Tim Kuehn on 17-Jun-2015 09:10

Even with NO-ERROR? 

If that was the case, I'd expect you'd have the same problem with 

FIND table WHERE ... NO-ERROR.

[collapse]
On Wed, Jun 17, 2015 at 10:05 AM, James Palmer <bounce-jdpjamesp@community.progress.com> wrote:
Reply by James Palmer

Yeah but I'm running the code on the AppServer and that fills up the AppServer logs with errors.

Stop receiving emails on this subject.

Flag this post as spam/abuse.




--
Tim Kuehn:  Senior Consultant  - TDK Consulting Services
President - Ontario PUG 
Program Committee Chair - PUG Challenge Americas, 
Course Instructor: Intro to OO Concepts for Procedural Programmers

Skype: timothy.kuehn
Ph: 519-576-8100
Cell: 519-781-0081
[/collapse]

Posted by ChUIMonster on 17-Jun-2015 09:12

So long as you are NOT depending upon the difference between "shared"
and "global shared" you can just always declare it "new global shared"
and not worry about who creates it first.

If you are depending on the behavior of multiple layers of plain old
shared then you should probably be begging for mercy.

(Just in case anyone is unaware... with "plain old shared" there is a
"stack" of multiple values that is driven by the order in which NEW
definitions occur. With "global shared" there is only ever one instance
of the variable.)


--
Tom Bascom
603 547 9043 (office)
603 396 4886 (cell)
tom@wss.com

Posted by James Palmer on 17-Jun-2015 09:12

Even with no-error. I get the error in Procedure Editor too.

DEFINE SHARED VARIABLE gv-fes-manager-Handle AS HANDLE NO-UNDO. 
/* ********************  Preprocessor Definitions  ******************** */


/* ***************************  Main Block  *************************** */


DEFINE VARIABLE lv-handle AS HANDLE    NO-UNDO.

ASSIGN lv-handle = gv-fes-manager-Handle NO-ERROR.


Posted by TheMadDBA on 17-Jun-2015 09:13

Why do you even need the shared variable?

I would just walk the procedure handle tree and remove all of them on a disconnect. Or check which ones you want to delete.

Posted by James Palmer on 17-Jun-2015 09:14

Not a bad shout Mr Mad.

Posted by TheMadDBA on 17-Jun-2015 09:20

:-)

Just saw your other thread regarding tons of persistent procedures... if this is what you are trying to clean up you have to walk the procedure list. It is really likely those shared variables will not hold all of the handles that you are looking for.

Posted by James Palmer on 17-Jun-2015 09:26

Yep indeedy it certainly makes life a lot easier. Just didn't go through my mind to do it like that. *fingers crossed*

Posted by TheMadDBA on 17-Jun-2015 09:37

This KB will give you the code to clean up all of the dynamic objects/procedures. Just change the messages to delete and put it in your disconnect procedure(s).

knowledgebase.progress.com/.../P124514

Posted by James Palmer on 17-Jun-2015 09:39

Thanks for that! :)

This thread is closed