🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5085

Re: Clarification on AutoInc fields

#5085
From: Formentz
Date: Tue, 10 Jul 2001 08:18
51 lines
3455 bytes
Thanks for the clarification, Umberto,
My program generates automatically the invoices, and the user can't delete
them by himself, and can't add manually an invoice.
So the invoices could have holes only if the execution of the insert query
goes bad, in effect something like a counter field or a select max(field)+1
could work, I'll have to finish the program and let it test by some users,
to choice the best method for my needs, but I think that max()+1 or counters
table should be the way, because it is more flexible than auto increment
fields, which numbers can't be recovered.

Thanks again,
Ciao
    Formentz
"Umberto Uderzo" <umberto@uderzo.it> ha scritto nel messaggio
news:3b4a37f2_2@dnews...
> Hi Francesco,
>
> Sure the mechanism i wrote in my previous mail needs a lock on the table.
In
> the application we are working on we do heavy use of table locks to
compute
> progressive numbers like the "fattura" one (i think fattura is "invoice"
in
> english, yes i'm italian). I know that the procedure that computes the
> invoice progressive number permits to a user lo take a number adding the
row
> to the invoice table. This permits to release immediately the lock on the
> table itself.
> In the same way other users can take their number. If a user releases the
> number (for example because he changed his mind about the invoice) he may
> create an hole into the sequence of numbers. This hole can be filled by a
> subsequent number request by another user, given that we are working on
the
> same day. If we go to the next day and there are holes in the numbering of
> the documents here it starts an automatic recovery procedure that alerts
the
> users and performs corrections. Sure this is a particular case, because
> invoices are actually processed after few days, so we can do modifications
> to the numbering before the real process. (The application is really huge
> and the server cannot lose time doing too much coherence testing, better
do
> this in the new day session). If you don't have these needs you sholud
> always solve the consecutive numbering problem. The MAX+1 or generator
> method seems to me to be the better since now, and sure you need to lock
the
> table to perform the query and to add the new row. But if your users can
> delete what they've created, you must find something like what i told
you...
>
> Ciao... Umberto Uderzo
>
Technical Details
Message-ID: <3b4ab942_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b3b532b$1_2@dnews> <3B3BD2D2.5F446F35@temporaldoorway.com> <3b3c3ad2_1@dnews> <3b3c7c38_1@dnews> <3b40f10e_2@dnews> <3b441a9c$2_2@dnews> <3b44f7c5_2@dnews> <3b456e91$1_2@dnews> <3b4a37f2_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,2eab2f6830ef7732
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-07-10 01:17:51 PST
From: "Formentz" <francesco@leotron.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3b3b532b$1_2@dnews> <3B3BD2D2.5F446F35@temporaldoorway.com> <3b3c3ad2_1@dnews> <3b3c7c38_1@dnews> <3b40f10e_2@dnews> <3b441a9c$2_2@dnews> <3b44f7c5_2@dnews> <3b456e91$1_2@dnews> <3b4a37f2_2@dnews>
Subject: Re: Clarification on AutoInc fields
Date: Tue, 10 Jul 2001 10:18:30 +0200
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 62.122.26.23
Message-ID: <3b4ab942_2@dnews>
X-Trace: dnews 994752834 62.122.26.23 (10 Jul 2001 01:13:54 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews