Subject | transaction the hundreth |
---|---|
Author | Olaf Kluge |
Post date | 2011-06-10T06:26:05Z |
Hello again.
Table A is the Idoc-Table
Table B the ORDER and Table C the ORDERPOS.
One stored procedure do the following
Insert a record in Table A
Insert a record in Table B with reference from Table A
Insert some records in Table C with reference from Table A and Table B
I have learned, that stored procedures do all in one transaction.
In Table A there is a trigger After Insert. The problem is, a new record was
inserted in Table A, the Trigger runs - but at this time the stored
procedure has inserted the records in Table B and Table C yet! Why? I think,
a stored procedure inserts and commits all data at the same time in one
transaction?
Currently I have solved the problem with a status-field. On Inserting in
Table A I set this to 50 (parking) and after Insert in all other tables I
update the status to 0 - and only at 0 the trigger runs.
Is there a better solution for this?
Thank you.
Friendly regards
Olaf
[Non-text portions of this message have been removed]
Table A is the Idoc-Table
Table B the ORDER and Table C the ORDERPOS.
One stored procedure do the following
Insert a record in Table A
Insert a record in Table B with reference from Table A
Insert some records in Table C with reference from Table A and Table B
I have learned, that stored procedures do all in one transaction.
In Table A there is a trigger After Insert. The problem is, a new record was
inserted in Table A, the Trigger runs - but at this time the stored
procedure has inserted the records in Table B and Table C yet! Why? I think,
a stored procedure inserts and commits all data at the same time in one
transaction?
Currently I have solved the problem with a status-field. On Inserting in
Table A I set this to 50 (parking) and after Insert in all other tables I
update the status to 0 - and only at 0 the trigger runs.
Is there a better solution for this?
Thank you.
Friendly regards
Olaf
[Non-text portions of this message have been removed]