Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-08 Thread Arnaud de Montard via 4D_Tech

> Le 1 juil. 2017 à 01:47, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
>> Yeah, I considered that direction too. I ruled it out because it's
>> introducing a lot of moving parts for the sake of being able to run some
>> code in a trigger. Since triggers aren't used so far that would be a pretty
>> big change.


> Le 8 juil. 2017 à 07:42, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
>> I have a method called “InitServerProcess_sv” with the EoS property
>> checked, and I call it from my InitProcess method. It sets up the OEC
>> method and does a few other things. Has worked like a charm for years.
> 
> ​That is a great idea. I just recently wrote a method to run like that when
> I start processes to capture the process startup data Joaquin clued me into
> last week. That is a good place to put such a call.


Changing your mind?  ;-)

-- 
Arnaud de Montard 


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-08 Thread Arnaud de Montard via 4D_Tech

> Le 7 juil. 2017 à 23:59, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Right, but what I'm seeing is a client side process which has an error
> handler installed. Running a method with EOS an error is blocking the
> server with the 4D native error handler. Even though the server has an
> error handler installed.

Hi Kirk,
from doc
• about EoS:
"When this attribute is checked, the execution context of the project method is 
comparable to that of triggers [...] 4D Server uses the "twin" process of the 
client process that requested the execution."
• about On err call:
"The scope of this command is the current process"
If you need On err call in the server side twin process, you must install it in 
that process - same as read/write, messages, variables, and so on. 


> This is following the what's in the docs:
> "ON ERR CALL is usually placed in the startup database method of an
> application, in order to handle errors for this application."

Incomplete if not wrong. It should say something like: 
"in order to handle errors for an application, ON ERR CALL is usually placed in 
the startup database method * AND IN ALL NEWLY CREATED PROCESS *"

-- 
Arnaud 


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-08 Thread Arnaud de Montard via 4D_Tech

> Le 8 juil. 2017 à 00:43, David Adams via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I'm not sure I'm following the basic setup because 'execute on server' can
> mean two things in 4D, can you clarify?

Still a command with a bad name. Confusion with the "execute on server" method 
property is boring. "New process server" was so simple… 

-- 
Arnaud de Montard 



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
Hi Ben,


On Fri, Jul 7, 2017 at 5:15 PM, Ben Kershaw via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> When a method with this property checked is executed, it runs in the
> context of the servers “twin” process (which isn’t really a twin, since it
> doesn’t really share anything with the client process). If you want your
> OEC method called for an error in that method, you have to set that in the
> server processes context.
>
> Do you have some sort of generic “init process” method that you call
> whenever you start a new process? If so, create a new method with the
> “Execute on Server” attribute checked, and then call THAT method from your
> “init process” method; this will initialize the server processes context.
>
​Well I do now...
​


> I have a method called “InitServerProcess_sv” with the EoS property
> checked, and I call it from my InitProcess method. It sets up the OEC
> method and does a few other things. Has worked like a charm for years.
>

​That is a great idea. I just recently wrote a method to run like that when
I start processes to capture the process startup data Joaquin clued me into
last week. That is a good place to put such a call.

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Alan Chan via 4D_Tech
We always install new On err call on triggers.

Alan Chan

4D iNug Technical <4d_tech@lists.4d.com> writes:
>I don't remember...triggers?

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread David Adams via 4D_Tech
Ben,

Thanks for these details, that's a huge help.

Does anyone know if this is documented anywhere? For that matter, are the
"twin" processes documented anywhere? I know that they were discussed at
some Summits in the past but, well, I haven't been to a Summit in over a
decade. Too. Darn. Far.

Thanks.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Ben Kershaw via 4D_Tech
Kirk Brooks wrote:

>Yeah, so I'm talking about a method with the Execute on server attribute (or 
>property - whatever) checked.

When a method with this property checked is executed, it runs in the context of 
the servers “twin” process (which isn’t really a twin, since it doesn’t really 
share anything with the client process). If you want your OEC method called for 
an error in that method, you have to set that in the server processes context.

Do you have some sort of generic “init process” method that you call whenever 
you start a new process? If so, create a new method with the “Execute on 
Server” attribute checked, and then call THAT method from your “init process” 
method; this will initialize the server processes context.

I have a method called “InitServerProcess_sv” with the EoS property checked, 
and I call it from my InitProcess method. It sets up the OEC method and does a 
few other things. Has worked like a charm for years.

Keep in mind, though, that unless you pass something back in a parameter (or 
handle it some other way), the method running on the client doesn’t know that 
there was an error during execution on the server - the error method was called 
on the server, so anything that happened during your error handler happened on 
the server and doesn’t change anything on the client.

Regards,
Ben

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread David Adams via 4D_Tech
> And this is really my question - is this a bug or am I missing something?

Try it compiled and interpreted and see what you find - it might work
compiled. Either way, if the behavior is undefined it would be great to get
it sorted out. Error dialogs popping up on the 4D Server machine? Not good.
I guess you can file a case on-line as a US Partner, or there are the
forums in France? I think that you know the procedures better than I do.

Thanks for pointing this out, it's important! Please let us know what you
learn.

P.S. If someone actually knows or if it's in the docs and we've missed it,
please chime in.

P.P.S. Kirk, I guess if you can reproduce it in the latest R release, you
could report it as a bug in that release...
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
David,
I was hoping you might weigh in here.

Yeah, so I'm talking about a method with the Execute on server attribute
(or property - whatever) checked.

So the situation is a client process is churning away and passes some
arrays off to the EOS method for processing on the server (looking things
up, grinding away).

It's not running on the client (that's the point) but it's not entirely
native to the server either. I'm hearing the guy from the Princess Bride
here... "If he's not completely dead that means he's a little bit alive."

And this is really my question - is this a bug or am I missing something?

On Fri, Jul 7, 2017 at 3:43 PM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm not sure I'm following the basic setup because 'execute on server' can
> mean two things in 4D, can you clarify?
>
> If you're running a method with the 'execute on server' flag set then, huh.
> What a great question! I hope this is what you mean because, yeah, that's a
> nice detail. I don't know the answer and I won't be shocked to learn that
> this is a gap in the ON ERR CALL coverage in 4D. (4D seems to approach
> error handling as something tacked on top of things - there isn't a
> predictable or systemic scheme for it. At least it doesn't look like there
> is.) Does anyone know? I've got it on my list to do a deep dive on the
> Execute on server flag, but, well, I've got a long list.
> 
>

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread David Adams via 4D_Tech
I'm not sure I'm following the basic setup because 'execute on server' can
mean two things in 4D, can you clarify?

Just to clarify my question...

$id:=Execute on server ("method name;etc)

If you're calling the Execute on server *command*, then you're spawning a
new process on 4D Server that runs there. No, it won't get the ON ERR CALL
you set up startup. The 'global' ON ERR CALL on 4D Server is for the
application process and..I don't remember...triggers? It used to depend on
compiled/interpreted and may depend on version. I don't remember off-hand
and would want to verify with your version anyway.

If you're running a method with the 'execute on server' flag set then, huh.
What a great question! I hope this is what you mean because, yeah, that's a
nice detail. I don't know the answer and I won't be shocked to learn that
this is a gap in the ON ERR CALL coverage in 4D. (4D seems to approach
error handling as something tacked on top of things - there isn't a
predictable or systemic scheme for it. At least it doesn't look like there
is.) Does anyone know? I've got it on my list to do a deep dive on the
Execute on server flag, but, well, I've got a long list.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
Jody,

Right, but what I'm seeing is a client side process which has an error
handler installed. Running a method with EOS an error is blocking the
server with the 4D native error handler. Even though the server has an
error handler installed. This is following the what's in the docs:

 "ON ERR CALL is usually placed in the startup database method of an
application, in order to handle errors for this application."

​Seems to suggest that would be the method called absent some specific
method and instead of the native 4D error handler. So that's why I expect
the server to use the handler I install there.

It seems like this is something specific to methods running EOS because
I've installed an error handler on both the server and the client process
but the 4D error handler is winding up with the call.


On Fri, Jul 7, 2017 at 2:52 PM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> On Error Call is process based. Therefore each process needs to call it.
>
>
-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Jody Bevan via 4D_Tech
On Error Call is process based. Therefore each process needs to call it.

Sincerely
Jody Bevan

> On Jul 7, 2017, at 16:45, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think I know the answer to this but think I'll ask anyway.
> 
> When my server starts up in installs an error handler, ON ERR
> CALL("err_log_only"). As the name implies it simply logs errors and keeps
> churning.
> 
> It doesn't seem to be called when a method called by Execute on server is
> running. At least I'm occasionally seeing errors on the server from a
> couple of methods. The thing about this is the process calling these
> methods has its own error handler installed as well which is not being
> called.
> 
> So, is this a bug or is it the case that methods running as EOS have to
> explicitly call their own error handler? And if that's the case, as I think
> about it, is this a situation like the rest of process vars and the 'twin'
> process where it's the same but different. Ie, I can have process vars with
> the same names on both the client and server side but these vars can have
> totally different contents. Is it therefore the case with the Error
> handler? Installing a given handler on the client process doesn't affect
> the server side. If that's the case it sounds like I should be adding an
> EOS method to my process init to install a handler on the server twin.
> 
> Anyone else encountered this? What did you do?
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
> 
> *- Edmund Burke*
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Kirk Brooks via 4D_Tech
I think I know the answer to this but think I'll ask anyway.

When my server starts up in installs an error handler, ON ERR
CALL("err_log_only"). As the name implies it simply logs errors and keeps
churning.

It doesn't seem to be called when a method called by Execute on server is
running. At least I'm occasionally seeing errors on the server from a
couple of methods. The thing about this is the process calling these
methods has its own error handler installed as well which is not being
called.

So, is this a bug or is it the case that methods running as EOS have to
explicitly call their own error handler? And if that's the case, as I think
about it, is this a situation like the rest of process vars and the 'twin'
process where it's the same but different. Ie, I can have process vars with
the same names on both the client and server side but these vars can have
totally different contents. Is it therefore the case with the Error
handler? Installing a given handler on the client process doesn't affect
the server side. If that's the case it sounds like I should be adding an
EOS method to my process init to install a handler on the server twin.

Anyone else encountered this? What did you do?

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**