On Transaction Commit Triggers to specific Table
------------------------------------------------
Key: CORE-4019
URL: http://tracker.firebirdsql.org/browse/CORE-4019
Project: Firebird Core
Issue Type: New Feature
Reporter: Daisson - JB Software
Priority: Minor
Hi everyone.
It's my first time here, and I'm already posting new features, sorry!.
OK, imagine this scenario:
TABLEA (
ID (PK),
CUSTOMERID,
VLTOTAL,
VLTOTAL1,
VLTOTAL2)
TABLE B (
ID (PK),
IDTABLEA (FK),
IDPRODUCT,
VALUE,
VL1,
VL2)
The fields VLTOTAL1 and VLTOTAL2 of TABLEA are a SUM of VL1 and VL2 from TABLEB
grouping by IDTABLEA.
Today I've an application that generate this SUM by trigger on AFTER INSERT of
TABLEB, but this consume a lot of CPU, specially in cases that TABLEB have a
thousand records. Another reason it's cause we use an script executing to
insert several records in TABLEA and, of course, another several records in
TABLEB.
Now, if we've an On Transaction Commit Trigger to TABLEB, the SUM would by
execute once only in the end of this transaction. The ideia of this type of
Triggers is the same as Database Triggers except that can be applied to a
specific table.
Maybe, another approach would be an On Before Transaction Commit to use the
same transaction isolation level to perform all of the commands. Or might be
existis an On After Transaction Commit in case we've to do same operation in
another table or another database (in FB 2.5) that's independ of the same
transaction.
Thank you.
Daisson.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel