[cvsnt] Re: Repository auditing with Oracle

Paulo Soares psoares at consiste.pt
Tue Jan 10 08:09:44 GMT 2006


----- Original Message ----- 
From: "Bo Berglund" <bo.berglund at telia.com>
Newsgroups: support.cvsnt
To: <cvsnt at cvsnt.org>
Sent: Tuesday, January 10, 2006 7:21 AM
Subject: Re: [cvsnt] Re: Repository auditing with Oracle


> On Tue, 10 Jan 2006 07:39:41 +0100, Olaf Groeger <Olaf.Groeger at gmx.de>
> wrote:
>
>>> The identity columns are always called ID - a habit I picked up years
>>> ago and don't plan on breaking in the future - so you could use the
>>> column name reliably in the code to identify them.   The trick is
>>> getting the correct one after the insert (since on a busy server many
>>> clients may be creating rows at the same time).
>>
>>No, the trick is to ask the database for an ID and use this ID for the
>>insert. The autoincrement feature of some DBs is only a convenient for
>>this, but performs the same internally. No matter how many clients are
>>connected, the database guarantees that a sequence-generated ID is valid.
>
> Out of curiosity as a non-Oracle dB programmer:
> Is there an Oracle function that returns a unique ID that will never
> repeat, but does so without inserting anything into any tables?
>

All the databases (maybe not sqllite) provide sequences that can be queried 
and auto-incremented in an atomic way. Oracle also has rowid fetch 
capability. If I assume that there's only one writer the sequence can even 
be generated internally by the cvsnt app and do away with all this identity 
need.

Paulo 




More information about the cvsnt mailing list