Re: CALL WORKER questions

2018-08-28 Thread Keisuke Miyako via 4D_Tech
there is a "poor man's interprocess messaging" technique, that works without 
workers or preemptive processes.

on your form, you have objects. the data source can be form local (a.k.a.) 
variables.
you get pointers to the objects (OBJECT Get pointer).
you pass those objects to New process. the new process should be cooperative.
you might want to update the UI to indicate that the action was recognised 
(disable button, etc)
in the new process, you read/write the dereferenced pointer, and call (post 
outside call) -1 to update the UI every n iterations (or seconds).
one of the pointers could be a flag that tells the process to abort.
on completion, you call the process. (post outside call).
of course, if you have access to CALL FORM, you can use it instead of calling 
the process.

preemptive processes are great,
but you shouldn't dismiss the advantage of cooperative processes,
especially if the task is tied to the user interface.
the ability to dereference a pointer that belongs to a different process,
as described above, is one of them.
(besides, preemptive mode is not available in 4D client)

the benefit preemptive process is that they are totally independent.
but that can be a curse, if you want some level of synchronisation.
for example, if you want to live update the UI,
you can't just CALL FORM in a loop.
the worker code must be written in a recursive way,
so that you give 4D a chance to process the message queue.

the code is much simple,
if you use a new process in cooperative mode.
because the scheduler coordinates the time slice between processes,
and you just have to call process (-1) once in a while to update the UI.

> 2018/08/29 10:22、Jim Crate via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> I am looking into using CALL WORKER / CALL FORM for an interface where 
> certain actions will query a service, which could take up to a few seconds. 
> Using CALL WORKER and CALL FORM would allow me to split the long-running part 
> to the worker without having to roll my own IP messaging and the On Outside 
> Call misery.




**
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
**

CALL WORKER questions

2018-08-28 Thread Jim Crate via 4D_Tech
I am looking into using CALL WORKER / CALL FORM for an interface where certain 
actions will query a service, which could take up to a few seconds. Using CALL 
WORKER and CALL FORM would allow me to split the long-running part to the 
worker without having to roll my own IP messaging and the On Outside Call 
misery. 

However, the problem is if the user spastically clicks things and several 
actions are queued which will take a few seconds to complete, there appears to 
be no way to remove unprocessed messages from the message queue. There also 
appears no way for a worker to see how many messages it has waiting, so it 
can’t discard them to skip to the last one itself. One possibility is using 
KILL WORKER before CALL WORKER. According to the documentation:

"If the  CALL WORKER command is called to send a message to a worker that was 
just killed by KILL WORKER, a new process is started. To make sure that there 
is only one process running at a time for a worker, the new process will start 
after the previous one is actually terminated.”

However, in the following sequence:

KILL WORKER(“QueryService”)
CALL WORKER(“QueryService”;”LongRunningQuery”;1)

… QueryService is processing query 1 ...
… user clicks something else …

KILL WORKER(“QueryService”)
CALL WORKER(“QueryService”;”LongRunningQuery”;2)

… QueryService is still processing query 1 ...
… user clicks something else …

KILL WORKER(“QueryService”)
CALL WORKER(“QueryService”;”LongRunningQuery”;3)

… more time passes ….
… query 1 finishes …

Is query 2 or query 3 started?

Is there a way to find out if the current worker process was killed? This would 
allow stopping in the worker before finishing, or not calling CALL FORM with 
results the form no longer wants. Maybe process status from PROCESS PROPERTIES? 

Jim Crate
**
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
**

Roy (Suzi) McGregor Paterson R.I.P

2018-08-28 Thread Wayne Stewart via 4D_Tech
Hi,

This was submitted to 4D Today (which I rarely update anymore) a few
days ago.  I've decided to post it here.  As far as I can tell
Roy/Suzi last posted in 2007 to the iNUG.

Sad news to report from the UK   Roy McGregor Paterson

Roy (a.k.a. Suzi) who worked with 4D from the early days passed away
on August 5th 2018.

Often present at the London 4D user group and attended many of the
Summits particularly in the U.S.A  ? always energetic, enthusiastic
and fun. An ardent Mac user originally working in 4D on complex
banking systems developed for JP Morgan.  Founder of -McGregor Tech,
very popular at the 4D conferences always up for a chat, techie debate
and of course a good laugh.

Suzi MacGregor Paterson died on 5th August 2018.

The funeral is on Monday 3rd September 2018 at Mortlake Crematorium
TW9 4EN London U.K. at 11.20 am.

A Tribute website is at:
suzi-paterson.muchloved.com 


Regards,

Wayne
**
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: How to tie 4D to barcode readers?

2018-08-28 Thread Stephen J. Orth via 4D_Tech
Kirk & Tony,

We do lots of bar coding systems every year using wedge-readers (keyboard 
input), RS-232 wireless, and IP-based wireless.  Going forward we are no longer 
doing RS-232 scanners as it is simply too much work for both us and our clients.

If a wedge-reader is the right tool, we use this first, otherwise all our 
projects are now IP-based scanners which are basically browsers.  Our 
communication is via web services, which are very, very fast to develop and 
provide very fast network communication.  The scanner displays on these units 
are small so generating HTML pages for this is really quite trivial.  We have 
also done a number of IP-based tablets and all of what I said is also true here.

Best,


Steve

*
  Stephen J. Orth
  The Aquila Group, Inc. Office:  (608) 834-9213
  P.O. Box 690   Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  s.o...@the-aquila-group.com
*
-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Kirk Brooks 
via 4D_Tech
Sent: Tuesday, August 28, 2018 6:56 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Kirk Brooks 
Subject: Re: How to tie 4D to barcode readers?

Tony,
How are you handling programming the barcode reader to include information
about what the barcode belongs to? Or are you using it as an extended
keyboard input?

On Tue, Aug 28, 2018 at 4:19 PM Tony Pollard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If you want the bar code scanning to be independent of where the user is
> on the UI, then there is usually a serial port emulation available on USB.
> GET SERIAL PORT MAPPING is useful for this on Mac.  You can then run
> serial comms in a separate process, which is handy if (for instance) the
> bar code readers are RF and being used at a distance from the computer
> (which also lets you run multiple scanners per computer).  Or I’d guess
> that there must be some IP wifi based bar code scanners out there by now,
> so you could (presumably) simply do a TCP_Open.
>
-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Keisuke Miyako via 4D_Tech
that is one of the beauties of components;

they can have object notation activated independent of the host's status. same 
for unicode mode.

as for the version being different, and not requiring recompilation, see 
documentation:

http://doc.4d.com/4Dv17/4D/17/Converting-databases-from-previous-versions.300-3743717.en.html

e.g.

Components4D v17 can open  v16, v15, v14, v13, v12 or v11 components, compiled 
or interpreted, directly without conversion or a confirmation dialog box. 
Remember that components are always opened in read-only mode. You do not need 
to recompile components but conversion to v17 is only possible for .4DB files 
and not for .4DC files.


> 2018/08/29 4:26、Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
>> I've noticed 4D often does not complain if the component is even from
>> a different major version (ie v15 - for example if the component was
>> purchased as a compiled project where you don't have the source code).



**
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: How to tie 4D to barcode readers?

2018-08-28 Thread Kirk Brooks via 4D_Tech
Tony,
How are you handling programming the barcode reader to include information
about what the barcode belongs to? Or are you using it as an extended
keyboard input?

On Tue, Aug 28, 2018 at 4:19 PM Tony Pollard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If you want the bar code scanning to be independent of where the user is
> on the UI, then there is usually a serial port emulation available on USB.
> GET SERIAL PORT MAPPING is useful for this on Mac.  You can then run
> serial comms in a separate process, which is handy if (for instance) the
> bar code readers are RF and being used at a distance from the computer
> (which also lets you run multiple scanners per computer).  Or I’d guess
> that there must be some IP wifi based bar code scanners out there by now,
> so you could (presumably) simply do a TCP_Open.
>
-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
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: How to tie 4D to barcode readers?

2018-08-28 Thread Tony Pollard via 4D_Tech
If you want the bar code scanning to be independent of where the user is on the 
UI, then there is usually a serial port emulation available on USB.
GET SERIAL PORT MAPPING is useful for this on Mac.  You can then run serial 
comms in a separate process, which is handy if (for instance) the bar code 
readers are RF and being used at a distance from the computer (which also lets 
you run multiple scanners per computer).  Or I’d guess that there must be some 
IP wifi based bar code scanners out there by now, so you could (presumably) 
simply do a TCP_Open.

Cheers!

Tony Pollard
Another Dimension Ltd




> On 24 Aug 2018, at 2:52 pm, mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi,
> 
> I am familiar with plugins to print barcodes, but don’t know what interface 
> is needed to get 4D to read barcodes from barcode wands, etc. Does anyone 
> have advice or recommendations?
> 
> Thanks,
> 
> Michael Ferguson
> Objective Systems
> 
> **
> 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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Benedict, Tom via 4D_Tech
Jeffrey Kain jeffrey.k...@gmail.com writes:

>Nope...

>If 4D makes a major change to the protocol they'll block it.  For deployment 
>we try to have matching versions always.
>
>> On Aug 28, 2018, at 2:24 PM, Dave Nasralla via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>>
>> One of our systems is developed with 4D Server (Team Developer) with
>> several coders connecting to make changes. If I move the Server from,
>> say v17.0 to v17.0 HF1 or a nightly build, do all the other developers
>> need to update their versions?

Ditto here. For Deployment we always match clients to server versions, even 
down to the build number.

Tom Benedict
Optum
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**
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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Dave Nasralla via 4D_Tech
Thanks, Tim. We use the "Current version:" setting to for all the
clients to update to the same version as the server.

What do you do about components? 4D POP is a good example. Those are
not distributed as source code, but rather compiled .4DC files. As far
as I can tell there are no v17 versions on the 4D website.

dave
On Tue, Aug 28, 2018 at 1:01 PM Timothy Penner via 4D_Tech
<4d_tech@lists.4d.com> wrote:
>
> Keep in mind that 4D QA does not test mixing and matching different versions 
> of client and server - there are way too many permutations... QA only tests 
> the same build of the client with the same build of the server. It is 
> typically the expectation that the version of 4D Client will match 4D Server, 
> although, it is only enforced when there are specific changes to the protocol.
>
> I think the following tech note explains the situation and provides code 
> examples of how you can handle it via 4D code:
>
> Tech Note: Validation of Client Build Version
> http://kb.4d.com/assetid=77112
> PRODUCT: 4D Server | VERSION: 14.0 | PLATFORM: Mac & Win
> Published On: July 24, 2014
> This technical note will provide more insight on the changes between 4D 
> releases and the difference and significance between the versions and build 
> numbers. The code changes between different builds of 4D can cause errors and 
> unexpected behaviors may occur when running mismatched builds between clients 
> and servers. While 4D has a mechanism to prevent connection of mismatching 
> Clients and Server, it isn't strongly enforced for builds of the same 
> version. This Technical Note will also provide a technique and methods to 
> address this problem.
>
>
> -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
> **



-- 
David Nasralla
Clean Air Engineering
**
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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Jeffrey Kain via 4D_Tech
Hardly ever.  Only if we make changes to it.

> On Aug 28, 2018, at 3:01 PM, Dave Nasralla via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Do you recompile each component with each
> deploy for minors?
> I've noticed 4D often does not complain if the component is even from
> a different major version (ie v15 - for example if the component was
> purchased as a compiled project where you don't have the source code).

**
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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Timothy Penner via 4D_Tech
Keep in mind that 4D QA does not test mixing and matching different versions of 
client and server - there are way too many permutations... QA only tests the 
same build of the client with the same build of the server. It is typically the 
expectation that the version of 4D Client will match 4D Server, although, it is 
only enforced when there are specific changes to the protocol.

I think the following tech note explains the situation and provides code 
examples of how you can handle it via 4D code:

Tech Note: Validation of Client Build Version
http://kb.4d.com/assetid=77112
PRODUCT: 4D Server | VERSION: 14.0 | PLATFORM: Mac & Win
Published On: July 24, 2014
This technical note will provide more insight on the changes between 4D 
releases and the difference and significance between the versions and build 
numbers. The code changes between different builds of 4D can cause errors and 
unexpected behaviors may occur when running mismatched builds between clients 
and servers. While 4D has a mechanism to prevent connection of mismatching 
Clients and Server, it isn't strongly enforced for builds of the same version. 
This Technical Note will also provide a technique and methods to address this 
problem.


-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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Dave Nasralla via 4D_Tech
Thanks Jeff. For the Deployment, we use the server machine, so the
clients will always have matching versions (Windows and Mac).
What about the components? Do you recompile each component with each
deploy for minors?
I've noticed 4D often does not complain if the component is even from
a different major version (ie v15 - for example if the component was
purchased as a compiled project where you don't have the source code).

dave
On Tue, Aug 28, 2018 at 12:42 PM Jeffrey Kain via 4D_Tech
<4d_tech@lists.4d.com> wrote:
>
> Nope...
>
> If 4D makes a major change to the protocol they'll block it.  For deployment 
> we try to have matching versions always.
>
> > On Aug 28, 2018, at 2:24 PM, Dave Nasralla via 4D_Tech 
> > <4d_tech@lists.4d.com> wrote:
> >
> > One of our systems is developed with 4D Server (Team Developer) with
> > several coders connecting to make changes. If I move the Server from,
> > say v17.0 to v17.0 HF1 or a nightly build, do all the other developers
> > need to update their versions?
>
> **
> 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
> **



-- 
David Nasralla
Clean Air Engineering
**
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: Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Jeffrey Kain via 4D_Tech
Nope... 

If 4D makes a major change to the protocol they'll block it.  For deployment we 
try to have matching versions always.

> On Aug 28, 2018, at 2:24 PM, Dave Nasralla via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> One of our systems is developed with 4D Server (Team Developer) with
> several coders connecting to make changes. If I move the Server from,
> say v17.0 to v17.0 HF1 or a nightly build, do all the other developers
> need to update their versions?

**
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
**

Team Developer - Do all developers need to be on same minor version?

2018-08-28 Thread Dave Nasralla via 4D_Tech
Hi all,

One of our systems is developed with 4D Server (Team Developer) with
several coders connecting to make changes. If I move the Server from,
say v17.0 to v17.0 HF1 or a nightly build, do all the other developers
need to update their versions?

4D does not complain when you connect, as long as your major version
is the same (not sure about, say 16.1 vs 16.2)

dave

-- 
David Nasralla
Clean Air Engineering
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Chip Scheide via 4D_Tech
I use longings as relational keys because it is easier to track down 
when the user(s) come to me as ask why some related(?) data is not 
where it should be.
[table]ID = 1234 
is a lot easier to work with then
[table]ID = B83F47092A384821A9FABA5379C3CCC0 
when try to track data.

I don't use relational keys for user data. Requisition Numbers, Sample 
ID, etc -- BUT -- these values need to be created too. In some 
instances either the user, or the usage, dictate a 'non-broken' 
sequence of values. 

This discussion can help to design a mechanism to fill that need.

In my systems the users can define their own sequence. They can setup 
the length, whether it is purely numeric (1,2,3,4 ..) or alphanumeric 
like most state's license plates (ABC123, ABC124 etc), include 
assignment date as part of the sequence value (ABC08-28-18), include 
other fixed text in the sequence (ABC-123,ABC-124), as well as indicate 
whether the sequence is to be 'unbroken'.

At some places, it is necessary to make an assignment of these (user 
defined) IDs before other records are created, not because the other 
records are (directly) dependent on the ID, but because ID order is 
important.

scenario
mom and her offspring are being entered into the system. Both use the 
same user created sequence for their respective, user visible, IDs. 
Also each need an internal relational ID.

Mom - needs to have the user created/visible ID generated before the 
offspring, so that while the IDs do not need to be sequential (1,2,3) 
they do need to be ordinal (1, 5,6,7,8).
The offspring, in this system, are created and displayed through a 
secondary process spawned from the Mother's entry process. So... mom 
gets a relational ID, and a user defined ID on record creation, so that 
offspring are properly IDed.


On Tue, 28 Aug 2018 16:29:54 +, Benedict, Tom via 4D_Tech wrote:
> Kirk Brooks writes:
> 
>> I am surprised this thread has drawn so much discussion. It's good
>> discussion but scanning back over it a key point is that all of these
>> contortions and workarounds to preserve a number sequence are based on the
>> single design decision to use an invoice (in this case) number as a key
>> field. I'm not criticizing of course - I used to do this as well and still
>> have a few cases where that sort of design exists though nothing involving
>> number series where gaps are an issue. Not to mention I've been doing 4D
>> long enough to recall the first discussions about data normalization the
>> community had and the, erm, hesitant embrace of it by many.
> 
> Thank you Kirk for finally mentioning this. The use of 'magic 
> numbers' is tempting, but ultimately leads to lots of work to 
> support. Keys should have no meaning.
> 
> That said, the need to manage sequence numbers without gaps is 
> legitimate and an interesting subject (as this thread has 
> illustrated). Just don't use them as relational keys, or if you do, 
> make sure you do it with your eyes open.
> 
> Tom Benedict
> Optum
> 
> 
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
> to which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
> that any dissemination, distribution or copying of this e-mail is
> prohibited. If you have received this e-mail in error, please notify the
> sender by replying to this message and delete this e-mail immediately.
> **
> 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
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Bernd Fröhlich via 4D_Tech
Kirk Brooks:

> scanning back over it a key point is that all of these
> contortions and workarounds to preserve a number sequence are based on the
> single design decision to use an invoice (in this case) number as a key
> field.

Nope, the invoice number has never been a key field over here.

Greetings from Germany,
Bernd Fröhlich
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Benedict, Tom via 4D_Tech
Kirk Brooks writes:

>I am surprised this thread has drawn so much discussion. It's good
>discussion but scanning back over it a key point is that all of these
>contortions and workarounds to preserve a number sequence are based on the
>single design decision to use an invoice (in this case) number as a key
>field. I'm not criticizing of course - I used to do this as well and still
>have a few cases where that sort of design exists though nothing involving
>number series where gaps are an issue. Not to mention I've been doing 4D
>long enough to recall the first discussions about data normalization the
>community had and the, erm, hesitant embrace of it by many.

Thank you Kirk for finally mentioning this. The use of 'magic numbers' is 
tempting, but ultimately leads to lots of work to support. Keys should have no 
meaning.

That said, the need to manage sequence numbers without gaps is legitimate and 
an interesting subject (as this thread has illustrated). Just don't use them as 
relational keys, or if you do, make sure you do it with your eyes open.

Tom Benedict
Optum


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Kirk Brooks via 4D_Tech
I am surprised this thread has drawn so much discussion. It's good
discussion but scanning back over it a key point is that all of these
contortions and workarounds to preserve a number sequence are based on the
single design decision to use an invoice (in this case) number as a key
field. I'm not criticizing of course - I used to do this as well and still
have a few cases where that sort of design exists though nothing involving
number series where gaps are an issue. Not to mention I've been doing 4D
long enough to recall the first discussions about data normalization the
community had and the, erm, hesitant embrace of it by many.

This thread illustrates a way structural decisions manifest over time. It
jumps out at me particularly now because I'm finding this especially true
working with v17 and ORDA - the coding flows so easily if the structure
supports it and can become extremely complicated when it doesn't. Something
I like about working with ORDA (which I'm misusing as a collective noun for
all the 'new' language features) is how easy it is to abstract the key
value of a record without having to work with the actual value. This makes
using UUIDs for key values much easier. I like UUIDs for key values
precisely because it eliminates any lazy kludge to use it as part of the
data - it's always part of the structure. True, looking at a column of
UUIDs is not as useful as looking at  column of longints. If I need or want
a serial record count I add it as a separate field as I do something like
invoice, order, check or inventory transaction numbers. Years ago it could
matter if a couple of extra fields were in a table (though you wouldn't
guess looking at a lot of mature 4D structures) but not so much now.

If I want a number series to remain pristine I assign the value as the very
last action prior to saving and validating the transaction. From that point
on a missing number is a management issue for users and not a programming
issue for me.

Another technique I'm using more and more for things like identifiers is
encoding longints in a base 26 alpha string (a=0, b=1, ...). I got the idea
from airline tickets. I noticed all my reservations and such have been
identified by an alpha code of a few letters. For instance, 10546789
encodes to XCBTT. Well that's a lot easier to recognize and recall and it
sorts.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Richard Wright via 4D_Tech
It allows you to work with related records as if they were subrecords. For 
example, you open an Invoice and start a transaction so that changes to line 
items can be rolled back if the Invoice is cancelled (something that 
automatically happened with subrecords). But then you want to drill down to 
another table related to Invoices and have those changes treated independently 
of the whether or not you cancel the Invoice. This is also how it worked with 
subrecords and was actually a very important feature of subrecords—that they 
were considered part the parent record and not independent; like structured 
data within a field.


Richard Wright
DataDomain
rwri...@datadomainsoftware.com



> Date: Mon, 27 Aug 2018 13:08:32 -0700
> From: Kirk Brooks 
> 
> Hey guys - the very issue with the record counter is sketched out in the
> discussion about Suspending Transactions:
> 
> http://doc.4d.com/4Dv16/4D/16.3/Suspending-transactions.300-3652126.en.html
> 
> 
> I had missed this - it's quite a feature.
> 
> On Mon, Aug 27, 2018 at 7:54 AM Keisuke Miyako via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> transactions can be paused since v16
>> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===



**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Pat Bensky via 4D_Tech
Dave,
That's fine as long as the id number isn't being used for something else
... in our case, the id numbers are used as the key field for relating data
from other tables, so this needs to be assigned when the record is created
):
Pat

On Tue, 28 Aug 2018 at 15:32, Dave Nasralla via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Bernd,
>
> I ran into a similar situation with Proposal and Project numbers. My
> decision was to not give the number out until they saved the record.
> This prevented people from using the number elsewhere (say for
> purchasing, etc) without a saved record in the system.
>
> dave
> On Tue, Aug 28, 2018 at 12:46 AM Bernd Fröhlich via 4D_Tech
> <4d_tech@lists.4d.com> wrote:
> >
> > Pat Bensky:
> >
> > > The important thing is that all record cancellations go through a
> > > *CancelRecord* method.
> > > I created a [SpareRecordNumbers] table which contains 3 fields: unique
> id,
> > > table number, and spare record number
> >
> > > As I said, it hasn't been thoroughly tested yet. So please feel free to
> > > chime in if you can see any flaws!
> >
> >
> > I have a similar system for invoice numbers.
> > Works perfectly in theory but in real life once or twice a year we got a
> missing invoice number.
> > Took me some time to figure out how it got lost (very obvious, once you
> know):
> >
> > User starts writing the invoice - gets a number through the system.
> > User goes home, leaving the invoice open.
> > User is disconnected, so the number is never returned.
> >
> > Now I look for lost number on every restart and if I find one I put it
> in the recycling bin.
> > Never lost a number since.
> >
> > Greetings from Germany,
> > Bernd Fröhlich
> > **
> > 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
> > **
>
>
>
> --
> David Nasralla
> Clean Air Engineering
> **
> 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
> **



-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Dave Nasralla via 4D_Tech
Hi Bernd,

I ran into a similar situation with Proposal and Project numbers. My
decision was to not give the number out until they saved the record.
This prevented people from using the number elsewhere (say for
purchasing, etc) without a saved record in the system.

dave
On Tue, Aug 28, 2018 at 12:46 AM Bernd Fröhlich via 4D_Tech
<4d_tech@lists.4d.com> wrote:
>
> Pat Bensky:
>
> > The important thing is that all record cancellations go through a
> > *CancelRecord* method.
> > I created a [SpareRecordNumbers] table which contains 3 fields: unique id,
> > table number, and spare record number
>
> > As I said, it hasn't been thoroughly tested yet. So please feel free to
> > chime in if you can see any flaws!
>
>
> I have a similar system for invoice numbers.
> Works perfectly in theory but in real life once or twice a year we got a 
> missing invoice number.
> Took me some time to figure out how it got lost (very obvious, once you know):
>
> User starts writing the invoice - gets a number through the system.
> User goes home, leaving the invoice open.
> User is disconnected, so the number is never returned.
>
> Now I look for lost number on every restart and if I find one I put it in the 
> recycling bin.
> Never lost a number since.
>
> Greetings from Germany,
> Bernd Fröhlich
> **
> 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
> **



-- 
David Nasralla
Clean Air Engineering
**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Chuck Miller via 4D_Tech
Thanks. As I said I was not sure. 

Regards

Chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any action in reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Aug 27, 2018, at 11:02 PM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I'm pretty sure calling SUSPEND TRANSACTION more than once without resuming 
> in between causes a run time error.
> 
> I just tried this and my changes are saved as I would expect:

**
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: New record numbering system and CALL WORKER

2018-08-28 Thread Pat Bensky via 4D_Tech
Good point, Bernd. I will implement that also.
Pat

On Tue, 28 Aug 2018 at 07:46, Bernd Fröhlich via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Pat Bensky:
>
> > The important thing is that all record cancellations go through a
> > *CancelRecord* method.
> > I created a [SpareRecordNumbers] table which contains 3 fields: unique
> id,
> > table number, and spare record number
>
> > As I said, it hasn't been thoroughly tested yet. So please feel free to
> > chime in if you can see any flaws!
>
>
> I have a similar system for invoice numbers.
> Works perfectly in theory but in real life once or twice a year we got a
> missing invoice number.
> Took me some time to figure out how it got lost (very obvious, once you
> know):
>
> User starts writing the invoice - gets a number through the system.
> User goes home, leaving the invoice open.
> User is disconnected, so the number is never returned.
>
> Now I look for lost number on every restart and if I find one I put it in
> the recycling bin.
> Never lost a number since.
>
> Greetings from Germany,
> Bernd Fröhlich
> **
> 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
> **



-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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
**