Re: startup progress on server

2018-08-06 Thread Keisuke Miyako via 4D_Tech
c.f. ACI0096115 (fixed in v17), ACI0094811 (fixed in v17, 16.3.HF5), ACI0097654 
(fixed in 16R6)

I recall the workaround prior to the fix was to duplicate the numeric menu 
reference ( i.e. $menu:=Create menu(1) )
instead of using design mode directly ( SET MENU BAR(1) )

but I may be wrong.



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

RE: startup progress on server

2018-08-06 Thread Timothy Penner via 4D_Tech
> So what’s the recommendation on giving startup progress so they know that the 
> server hasn’t frozen at some point during the startup method?

To the best of my knowledge, we do not recommend any sort of UI on the server.
So, it is hard to make a recommendation for something we don’t recommend.

Trying to help even though we don’t recommend a UI on the server -

If this was on a client or standalone I would suggest the Progress component:
http://doc.4d.com/4Dv15/4D/15/Progress-New.301-2399698.en.html
http://doc.4d.com/4Dv15/4D/15/Progress-SET-TITLE.301-2399709.en.html
http://doc.4d.com/4Dv15/4D/15/Progress-QUIT.301-2399699.en.html

C_LONGINT($vlProg)
$vlProg:=Progress New
Progress SET TITLE($vlProg;"Title of window for doing stuff 1";-1;"description 
of stuff being done")
// do stuff 1
Progress SET TITLE($vlProg;"Title of window for doing stuff 2";-1;"description 
of stuff being done")
// do stuff 1
Progress QUIT($vlProg)

However, I don’t think that using the progress component would be appropriate 
for the server because it is still a UI and in general our documentation 
suggests against any sort of UI on the server..

Regarding notifying the administrator about ongoing startup tasks - what about 
using the DISPLAY NOTIFICATION command?
http://doc.4d.com/4Dv15/4D/15.6/DISPLAY-NOTIFICATION.301-3818361.en.html
-Tim



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

Re: startup progress on server

2018-08-06 Thread Randy Jaynes via 4D_Tech




> On Aug 6, 2018, at 12:39 PM, Timothy Penner via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> Regarding  the menu bars on server -
> 
>> Calling SET MENU BAR during On Server Startup
>> - this crash will occur in a test database with only this line of code in 
>> the On Server Startup method
> 
> This *was* a known issue, it was filed as ACI0097391. It should be fixed in 
> the latest v16 and v17 releases, I am not sure about the R release.
> 
> However, keep in mind that the command SET MENU BAR is documented to have no 
> effect on the server;
> http://doc.4d.com/4Dv17/4D/17/Stored-Procedures.300-3743249.en.html 
> 
> ^ So calling SET MENU BAR on the server is a mistake.
> 
> A wrapper for the SET MENU BAR command could look like this:
> 
> If(Application type#4D Server)
>SET MENU BAR($1)
> End if

Already done. We knew it was being ignored on server so hasn’t been an issue 
until now. It was the first change I made in trying to track this all down.

> 
> Regarding the progress window -
> 
>> opening a small window for showing progress messages during the startup 
>> routine. Especially important while running internal data update routines
> 
> The documentation summarizes it like this:
> {
> Generally speaking, stored procedures executed on the server should not deal 
> with interface items (such as menus, windows, forms...). Indeed the interface 
> is not managed on the server's side.
> Commands displaying dialog boxes on the server machine as well as dialog 
> boxes dealing with data entry should be avoided.
> }

Which we do in general, yes.

> 
> So I think this should probably be avoided also.

So what’s the recommendation on giving startup progress so they know that the 
server hasn’t frozen at some point during the startup method?

We do a simple order like
open window
… do stuff
DISPLAY  RECORD   <——displays a form with a picture and a text variable that we 
update
…do stuff
DISPLAY  RECORD
…do stuff
close window

We’ve been doing this for at least 18 years.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com  • 845.687.3741 • PrintPoint, Inc 
• 57 Ludlow Lane • Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 

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

RE: startup progress on server

2018-08-06 Thread Timothy Penner via 4D_Tech
Regarding  the menu bars on server -

> Calling SET MENU BAR during On Server Startup
> - this crash will occur in a test database with only this line of code in the 
> On Server Startup method

This *was* a known issue, it was filed as ACI0097391. It should be fixed in the 
latest v16 and v17 releases, I am not sure about the R release.

However, keep in mind that the command SET MENU BAR is documented to have no 
effect on the server;
http://doc.4d.com/4Dv17/4D/17/Stored-Procedures.300-3743249.en.html
^ So calling SET MENU BAR on the server is a mistake.

A wrapper for the SET MENU BAR command could look like this:

If(Application type#4D Server)
SET MENU BAR($1)
 End if

Regarding the progress window -

>opening a small window for showing progress messages during the startup 
>routine. Especially important while running internal data update routines

The documentation summarizes it like this:
{
Generally speaking, stored procedures executed on the server should not deal 
with interface items (such as menus, windows, forms...). Indeed the interface 
is not managed on the server's side.
Commands displaying dialog boxes on the server machine as well as dialog boxes 
dealing with data entry should be avoided.
}

So I think this should probably be avoided also.

Kind Regards,

Tim PENNER




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

Re: startup progress on server

2018-08-06 Thread Randy Jaynes via 4D_Tech
SET MENU BAR has never actually done anything to change the menu bar on the 
server, so I think it’s just been ignored all these years.

It’s never been a problem until v16R6 Server. Of course, this is the first time 
we’ve had 64bit on Mac, so it may be related to that.

Either way, starting a stored procedure on server seems to be ignoring it 
again, so I’ve got that going for me.

Will test the 32 vs 64bit questions later.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com  • 845.687.3741 • PrintPoint, Inc 
• 57 Ludlow Lane • Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Aug 6, 2018, at 11:54 AM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> Just curious, does SET MENU BAR actually work from a Stored Procedure process 
> on 4D Server?I thought this was not supported. 
> 
> You can open a window from a Stored Procedure on 4D Server but I didn’t think 
> you could install your own menu bar, and have your own items in the menu bar 
> that you could select and have them perform actions. 

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

Re: startup progress on server

2018-08-06 Thread Randy Jaynes via 4D_Tech
There could be, sure.

John DeSoi makes  a good point that it could b the 64bit version as opposed to 
32bit.

As I mentioned, the startup method was working fine up through v15.4 HF3, which 
was the last version before jumping to v16R6, but we went right to the 64bit 
version of that so I’ll have to test to be sure on that.

For now, I’m fine with using a stored procedure for the startup method.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com  • 845.687.3741 • PrintPoint, Inc 
• 57 Ludlow Lane • Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Aug 6, 2018, at 10:24 AM, Dennis, Neil  > wrote:
> 
> Randy
> 
> There might be something else in the mix, all of my databases do a set menu 
> bar during startup and open a window for progress. I'm not having the same 
> crash you are. However I haven't tested with 4D v16r6.
> 
> Neil

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

Re: startup progress on server

2018-08-06 Thread Randy Jaynes via 4D_Tech
We call QUIT 4D directly with no timer.

Our On Exit and On Server Shutdown methods already do checks to be sure the 
processes we started are dead.

I’m hoping for sure this is all that is needed. I didn’t think to test if this 
was only an issue related to 64bit version of server on Mac.

I’ll have to give that a shot as well. Regardless, at the moment at least, 
starting a new Stored Procedure to run the startup code seems to have done the 
trick for me.

I’ll test 32bit server on Mac later today. Have some other TS issues to catch 
up on first.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com  • 845.687.3741 • PrintPoint, Inc 
• 57 Ludlow Lane • Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Aug 6, 2018, at 10:54 AM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> Randy,
> 
> I'll be interested to hear if this permanently fixes the problem. I'm still 
> having random crash on quit errors on 4D Server (16.3HF4, 64-bit). Never a 
> problem in version 15, 32-bit. I have never connected crashing to a status 
> interface, but in my case it has always run in a separate process. I just 
> made a change to ensure that process is dead before QUIT 4D is called on the 
> server. Maybe that will completely solve it.
> 
> Did you look at the backtrace from the crash log? I would be interested to 
> see if we are experiencing the same issue. Below is what I see. I wonder if 
> that is related to displaying the countdown timer - I'm quitting with QUIT 
> 4D(60).

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

Re: startup progress on server

2018-08-06 Thread Tim Nevels via 4D_Tech
On Aug 6, 2018, at 10:21 AM, Randy Jaynes wrote:

> Ok. So moving our STARTUP method into a stored procedure using
>   $procID:=New Process(“STARTUP”;512000;”On Server Startup)
> 
> takes care of BOTH problems.
> 
> So it looks like the Application Server process on 4D Server v16R6 and higher 
> is more sensitive to interface related commands like
>   OPEN WINDOW
>   SET MENU BAR
>   DISPLAY RECORD
> 
> For the record, this startup method was fine up through 4D v15.4 HF3.

Just curious, does SET MENU BAR actually work from a Stored Procedure process 
on 4D Server?I thought this was not supported. 

You can open a window from a Stored Procedure on 4D Server but I didn’t think 
you could install your own menu bar, and have your own items in the menu bar 
that you could select and have them perform actions. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: startup progress on server

2018-08-06 Thread John DeSoi via 4D_Tech
Randy,

I'll be interested to hear if this permanently fixes the problem. I'm still 
having random crash on quit errors on 4D Server (16.3HF4, 64-bit). Never a 
problem in version 15, 32-bit. I have never connected crashing to a status 
interface, but in my case it has always run in a separate process. I just made 
a change to ensure that process is dead before QUIT 4D is called on the server. 
Maybe that will completely solve it.

Did you look at the backtrace from the crash log? I would be interested to see 
if we are experiencing the same issue. Below is what I see. I wonder if that is 
related to displaying the countdown timer - I'm quitting with QUIT 4D(60).

Thread 46 Crashed:: QUIT_SERVER (id = -11)
0   4d.com.Map Server.app   0x000108e88fbc 
V4DClientProcessManager::Clear(bool) + 128
1   4d.com.Map Server.app   0x000108e8c1eb 
V4DServer::Unpublish() + 87
2   4d.com.Map Server.app   0x000108e8d1e6 
V4DServer::_Shutdown(xbox::VTime&, xbox::VString const*, xbox::VString const*, 
VDatabaseStartupParameters*, xbox::VUUID const*) + 38
3   4d.com.Map Server.app   0x000108e8d300 
V4DServer::Shutdown(int, xbox::VString const*, xbox::VString const*, 
VDatabaseStartupParameters*, xbox::VUUID const*) + 120
4   4d.com.Map Server.app   0x00010915a636 
do_quit4d(runtime4dLink*) + 123
5   4d.com.Map Server.app   0x000108ce5028 
VDBLanguageContext::ExecuteCommand(runtime4dLink*) + 62
6   4d.com.Map Server.app   0x000108cd9530 
VDBLanguageContext_compiled::ExecuteRuntimeCommand(int, int, 
champvar_template<256>**) + 94
7   4d.com.Map Server.app   0x000108afeff1 rt_CallRuntime4D2 + 
45
8   ??? 0x00010e364a43 0 + 4533406275
9   4d.com.Map Server.app   0x00010907fbcb CallAsmPart2 + 65
10  ??? 0x7051e6e0 0 + 123145307678432
11  4d.com.Map Server.app   0x000108cd9354 
VDBLanguageContext_compiled::DoExecute(calcblock&, VCodeDescriptor*) + 164
12  4d.com.Map Server.app   0x000108ce3e18 
VDBLanguageContext::Execute(VDB4DTableProxy*, VFormContext*, short, int, int, 
champvar_template<256>**, VCodeDescriptor*) + 162
13  4d.com.Map Server.app   0x000108ce3a92 
VDBLanguageContext::ExecuteProjectMethod(VMethodInfo const*, int, 
champvar_template<256>**, VDB4DTableProxy*, VFormContext*, short, int) + 542
14  4d.com.Map Server.app   0x000108cbd08c 
V4DWorkerMessage::_Execute(VDBLanguageContext*, VFormContext*) + 110
15  4d.com.Map Server.app   0x000108cbd850 
V4DWorker::Run(V4DTaskConcrete*) + 208
16  4d.com.Map Server.app   0x000108e97da4 
Task4DStoredMethodProc(V4DTaskConcrete*, xbox::IRefCountable*) + 222
17  4d.com.Map Server.app   0x000108cb4360 
Task4DProc(V4DTaskConcrete*) + 910
18  4d.com.Map Server.app   0x000108cfb6c8 
V4DTaskManager::_Task4DProc(xbox::VTask*) + 160
19  com.4d.kernel   0x00010b0b02ee xbox::VTask::_Run() 
+ 78
20  com.4d.kernel   0x00010b0b54d6 
xbox::XMacTask_fiber::_ThreadProc(void*) + 70
21  com.4d.kernel   0x00010b0ef27f 
xbox::VMacFiber_thread::_ThreadProc(void*) + 31
22  com.apple.CoreServices.CarbonCore   0x7fff476e6072 CooperativeThread + 
282
23  libsystem_pthread.dylib 0x7fff6e6ba661 _pthread_body + 340
24  libsystem_pthread.dylib 0x7fff6e6ba50d _pthread_start + 377
25  libsystem_pthread.dylib 0x7fff6e6b9bf9 thread_start + 13




> On Aug 6, 2018, at 9:26 AM, Randy Jaynes via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Ok. So moving our STARTUP method into a stored procedure using
>   $procID:=New Process(“STARTUP”;512000;”On Server Startup)
> 
> takes care of BOTH problems.
> 
> So it looks like the Application Server process on 4D Server v16R6 and higher 
> is more sensitive to interface related commands like
>   OPEN WINDOW
>   SET MENU BAR
>   DISPLAY RECORD
> 
> For the record, this startup method was fine up through 4D v15.4 HF3.

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

Re: startup progress on server

2018-08-06 Thread Randy Jaynes via 4D_Tech
Ok. So moving our STARTUP method into a stored procedure using
$procID:=New Process(“STARTUP”;512000;”On Server Startup)

takes care of BOTH problems.

So it looks like the Application Server process on 4D Server v16R6 and higher 
is more sensitive to interface related commands like
OPEN WINDOW
SET MENU BAR
DISPLAY RECORD

For the record, this startup method was fine up through 4D v15.4 HF3.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com  • 845.687.3741 • PrintPoint, Inc 
• 57 Ludlow Lane • Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Aug 6, 2018, at 10:15 AM, Randy Jaynes via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> I’ve spent the morning trying to track down why our database started crashing 
> when we quit 4D Server v16R6 on Mac OS…I haven’t tested yet to see if it 
> affects the Windows version as well.
> 
> I have tracked down 2 contributors to the crash.
> 
>   1) Calling SET MENU BAR during On Server Startup
>   - this crash will occur in a test database with only this line 
> of code in the On Server Startup method
>   
>   2) opening a small window for showing progress messages during the 
> startup routine. Especially important while running internal data update 
> routines
> 
> We use the same STARTUP method for both a client’s On Startup method and 
> server’s On Startup method, putting checks for (Application Type = 4D Server) 
> in appropriate places to skip over some pieces of code not needed on the 
> server.
> 
> So, item #1 is easy to fix by checking if I’m running on server or not.
> 
> Item #2, however, I need to solve a different way.
> 
> So the question to everyone here is: how to do you give feedback to the user 
> when starting up 4D Server?
> 
> My first attempt after this email is to move the current STARTUP method into 
> a stored procedure on the server using New Process to see if it just runs as 
> is.
> 
> I just wanted to see what others might suggest as well.
> 
> This STARTUP method has been working fine through many versions of 4D and 4D 
> Server. I know every new version of 4D gets tighter and tighter in its 
> behavior and coding needs and I have to adapt. Not complaining. Just need to 
> find out how to get my code tighter. :-)
> 
> Randy
> 
> --
> Randy Jaynes
> Senior Programmer and Customer Support
> 
> http://printpoint.com   > • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane • 
> Palisades, NY 10964 
> Please send all email contacts to supp...@printpoint.com 
>   >
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html 
> 
> Options: https://lists.4d.com/mailman/options/4d_tech 
> 
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com 
> 
> **

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

RE: startup progress on server

2018-08-06 Thread Dennis, Neil via 4D_Tech
Randy

There might be something else in the mix, all of my databases do a set menu bar 
during startup and open a window for progress. I'm not having the same crash 
you are. However I haven't tested with 4D v16r6.

Neil






Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**