🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.linux
1 messages
1 total messages Started by Frank Wang Sun, 10 Dec 2000 12:31
serializing docref
#45
Author: Frank Wang
Date: Sun, 10 Dec 2000 12:31
38 lines
2001 bytes
Hi List,

I have a table with following structure:

CREATE TABLE InvMst(
    InvNo       integer     NOT NULL,
    DocRef      integer    NOT NULL,
    CONSTRAINT InvMst_PK PRIMARY KEY (InvNo),
) ;
CREATE UNIQUE INDEX InvMst_DocRef ON InvMst(DocRef);

Following are steps taken to insert a new record:

#1 Start a read commited transaction(read commited, rec_version, nowait)

#2 use a generator to assign a unique value to invno as primary key
#3 use  'select docref  from invmst order by docref desc' and get the first
record, plus 1 to get
    the next unused doc number and insert into the table(this is only
temporary)

#4 adding some records to the detail table(not listed here)

#5 repeat #3 to fetch a new doc number(just in case a record has been added
by other user), then commit.

my problem is, when multi users are connected, at step #3 I got an
exception:
"lock conflict on no wait transaction, attempt to store duplicate
values(visible to active transactions)
in unique index"

my understanding is, if not commited nothing can be seen by other
transactions, looks like not the case.
what should I do to be able to serialize(not using generator) docref in a
multi user version? thanks.

Frank
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads