Subject | RE: [firebird-support] Is it a Trigger Problem? |
---|---|
Author | Zoran |
Post date | 2019-07-18T12:26:15Z |
Hi András
I did that already. This is happening very seldom, so I have to wait.
I suspect some disk sectors are (going) bad and this could be a hardware
problem.
Thank you for suggestion.
Zoran
-----Original Message-----
From: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Sent: Thursday, July 18, 2019 1:01 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Is it a Trigger Problem?
Hi Zoran!
I suggest you to make unique key on
"T_ORDERCUSTOMER".OrderId
and
T_ORDERVEHICLE".OrderId
and you will get an exception when the secound row is inserted into the
tables.
Maybe this helps to find out where is the problem.
András
From: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Sent: Wednesday, July 17, 2019 4:47 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Is it a Trigger Problem?
This might sound impossible...
I have one master and two detail tables. Relation is defined thru Foreign
Key and cascade delete. When I insert a master row, the master table trigger
inserts one empty detail row (only master key column populated)) in each of
the two detail tables. So each master row has only one detail row in each of
two detail tables and that doesn't change during the life of a master row.
All works well. Very, very seldom my client gets two detail rows for the
same master row. Sometimes it is in detail 1 table, sometimes it is in
detail 2 table. There are 5 users updating and inserting new rows 8 hours a
day. Database size is small (about 10,000 rows in the main table).
Application code does not insert any rows into detail tables, just updates
them. There are several triggers in the database, but the only one that
touches detail tables is the one in the master table.
Now crazy question. How is this possible? Is there any special circumstance
in FB which might cause this?
Here is part of the trigger in master table:
if (INSERTING) then
begin
insert into "T_ORDERCUSTOMER" (OrderId) values (new.Id);
insert into "T_ORDERVEHICLE" (OrderId) values (new.Id); ....
Server: FB 3.4, Win 10 Pro, 12GB RAM
Workstations: Win 10 Home and Pro, 4-8GB RAM
Development: Delphi 10.3.1, Win 10 Ent, 32GB RAM
Tnx.
__________ Information from ESET Mail Security, version of virus signature
database 19701 (20190717) __________
The message was checked by ESET Mail Security.
http://www.eset.com
__________ Information from ESET Mail Security, version of virus signature
database 19705 (20190718) __________
The message was checked by ESET Mail Security.
http://www.eset.com
[Non-text portions of this message have been removed]
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item on the
main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at
http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
I did that already. This is happening very seldom, so I have to wait.
I suspect some disk sectors are (going) bad and this could be a hardware
problem.
Thank you for suggestion.
Zoran
-----Original Message-----
From: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Sent: Thursday, July 18, 2019 1:01 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Is it a Trigger Problem?
Hi Zoran!
I suggest you to make unique key on
"T_ORDERCUSTOMER".OrderId
and
T_ORDERVEHICLE".OrderId
and you will get an exception when the secound row is inserted into the
tables.
Maybe this helps to find out where is the problem.
András
From: firebird-support@yahoogroups.com <firebird-support@yahoogroups.com>
Sent: Wednesday, July 17, 2019 4:47 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Is it a Trigger Problem?
This might sound impossible...
I have one master and two detail tables. Relation is defined thru Foreign
Key and cascade delete. When I insert a master row, the master table trigger
inserts one empty detail row (only master key column populated)) in each of
the two detail tables. So each master row has only one detail row in each of
two detail tables and that doesn't change during the life of a master row.
All works well. Very, very seldom my client gets two detail rows for the
same master row. Sometimes it is in detail 1 table, sometimes it is in
detail 2 table. There are 5 users updating and inserting new rows 8 hours a
day. Database size is small (about 10,000 rows in the main table).
Application code does not insert any rows into detail tables, just updates
them. There are several triggers in the database, but the only one that
touches detail tables is the one in the master table.
Now crazy question. How is this possible? Is there any special circumstance
in FB which might cause this?
Here is part of the trigger in master table:
if (INSERTING) then
begin
insert into "T_ORDERCUSTOMER" (OrderId) values (new.Id);
insert into "T_ORDERVEHICLE" (OrderId) values (new.Id); ....
Server: FB 3.4, Win 10 Pro, 12GB RAM
Workstations: Win 10 Home and Pro, 4-8GB RAM
Development: Delphi 10.3.1, Win 10 Ent, 32GB RAM
Tnx.
__________ Information from ESET Mail Security, version of virus signature
database 19701 (20190717) __________
The message was checked by ESET Mail Security.
http://www.eset.com
__________ Information from ESET Mail Security, version of virus signature
database 19705 (20190718) __________
The message was checked by ESET Mail Security.
http://www.eset.com
[Non-text portions of this message have been removed]
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item on the
main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at
http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links