Subject | Re: Stopping indexes see through Transactions? |
---|---|
Author | johnsparrowuk |
Post date | 2004-03-26T17:59:32Z |
Excellent! Thank you!
John
--- In firebird-support@yahoogroups.com, "Ivan Prenosil"
<Ivan.Prenosil@s...> wrote:
John
--- In firebird-support@yahoogroups.com, "Ivan Prenosil"
<Ivan.Prenosil@s...> wrote:
> Use multicolumn PK/index, and assign CURRENT_TRANSACTIONTransactions?
> to the additional column.
>
> Ivan
>
>
> ----- Original Message -----
> From: "johnsparrowuk" <jsparrow@e...>
> To: <firebird-support@yahoogroups.com>
> Sent: Friday, March 26, 2004 2:33 PM
> Subject: [firebird-support] Stopping indexes see through
>same
>
> > If I insert something into a PK field (say '1'), and then do the
> > in another transaction context (without committing the first).It
> > will fail, yes?constraints -
> >
> > Presumably the same is true of other unique indexes or
> > they can 'see through' the transaction context?PK's
> >
> > Is there a way of preventing this from happening (maybe not with
> > but with indexes?)mytable'
> >
> > Sometimes I use a table as working storage for a sproc, and use
> > transacton isolation to prevent one instance seeing data from
> > another. When each instance is finnished they 'delete from
> > so the committed state of the table is always empty. (I alsoempty
> > the table at the start of the sproc, just to be sure!)context, so
> >
> > Good idea? I can't use PK's because these see through the
> > if I must maintain uniqueness I usually have a trigger:
> >
> > before insert trigger:
> > select count(*) from mytable where pk = :new.pk into :a;
> > if (a > 0) then
> > exception key_viol;
> >
> > Which seems a bit inefficient...
> >
> > I suppose I could use a non-unique index to make the trigger
> > faster.. ;)
> >
> > Thanks,
> >
> > John