Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"To YOU I'm an atheist; to God, I'm the Loyal Opposition." -- Woody Allen


devel / comp.databases.ingres / Re: Rules and commit

SubjectAuthor
* Rules and commitChris
`- Re: Rules and commitRoy Hann

1
Rules and commit

<4ed0508d-25b8-4cab-a99d-7a05fa381cefn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=295&group=comp.databases.ingres#295

  copy link   Newsgroups: comp.databases.ingres
X-Received: by 2002:a05:622a:4a0d:b0:420:3346:a94c with SMTP id fv13-20020a05622a4a0d00b004203346a94cmr899246qtb.6.1701465146556;
Fri, 01 Dec 2023 13:12:26 -0800 (PST)
X-Received: by 2002:a05:6214:20a7:b0:66d:32cc:3736 with SMTP id
7-20020a05621420a700b0066d32cc3736mr968480qvd.4.1701465146352; Fri, 01 Dec
2023 13:12:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ingres
Date: Fri, 1 Dec 2023 13:12:26 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:214a:8306:3b00:d0c1:257f:cf5d:c5ba;
posting-account=ZmFe8AoAAAAgQ_VrseEqhBDCJBWVBk2-
NNTP-Posting-Host: 2a02:214a:8306:3b00:d0c1:257f:cf5d:c5ba
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4ed0508d-25b8-4cab-a99d-7a05fa381cefn@googlegroups.com>
Subject: Rules and commit
From: vcx...@gmail.com (Chris)
Injection-Date: Fri, 01 Dec 2023 21:12:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Chris - Fri, 1 Dec 2023 21:12 UTC

Hi
If I have a rule which calls a dbp , triggered AFTER insert.
From the documentation I get that the rule is fired and the dbp called regardless if the transaction rollbacks or commits, because the dbp is considered part of the transaction.
With that I mean that the dbp does not get fired only after the inserted row is committed. Did I get that right?

What happens if inside the dbp I raise a db event which reads the data from the AFTER insert statement, but the transaction
wrapping the dpb or the same dbp rollbacks?
Is the db event called regardless if the transaction rollbacks or commits?, In that case the event can readdirty/ uncommitted or rolled back data?

Re: Rules and commit

<ukdut7$22qpm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=296&group=comp.databases.ingres#296

  copy link   Newsgroups: comp.databases.ingres
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: specia...@processed.almost.meat (Roy Hann)
Newsgroups: comp.databases.ingres
Subject: Re: Rules and commit
Date: Sat, 2 Dec 2023 00:48:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <ukdut7$22qpm$1@dont-email.me>
References: <4ed0508d-25b8-4cab-a99d-7a05fa381cefn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 2 Dec 2023 00:48:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="25a2d3dc2b41c9b7d72cbb512d824fbf";
logging-data="2190134"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nxSd0dOzCZVMp6l0SvGI2qYGtQToNxBU="
User-Agent: XPN/1.2.6 (Street Spirit ; Windows)
Cancel-Lock: sha1:sgqfTlAR1WArLTToAurntBIAJIg=
 by: Roy Hann - Sat, 2 Dec 2023 00:48 UTC

Chris wrote:

> If I have a rule which calls a dbp , triggered AFTER insert. From the
> documentation I get that the rule is fired and the dbp called regardless
> if the transaction rollbacks or commits, because the dbp is considered
> part of the transaction. With that I mean that the dbp does not get
> fired only after the inserted row is committed. Did I get that right?

That is correct. Some products do support so-called "deferred" rules
that are fired when the transaction is committed but Ingres does not.
Ingres rules execute procedures at the moment the triggering codition
is satisfied, regardless of whether the transaction will later be
rolled back.

> What happens if inside the dbp I raise a db event which reads the data
> from the AFTER insert statement, but the transaction wrapping the dpb
> or the same dbp rollbacks?

Rule fired DBPs execute within the context of the triggering
transaction. The DBP will see the updated data. It doesn't care whether
the transaction is rolled back in the future.

> Is the db event called regardless if the transaction rollbacks or
> commits?, In that case the event can readdirty/ uncommitted or rolled
> back data?

We're venturing into some philosophical territory here. There really
isn't any such thing as a "dirty" read within a transaction because it
is the unit of isolation. And to repeat, the DBP is called as soon as
the triggering condition is satisfied. (A further detail to keep in mind
is that when there are multiple rules that can be triggered at the
same time, the order in which they are triggered is explicitly NOT
defined. If you need things done in a specific order there are ways to
manage it but Ingres doesn't provide any built-in help to do it.)

Roy

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor