![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi, are triggers executed in parallel for parallel DML? What happens, if the same record is updated _twice_ in a bulk update? Something like this: forall i reloads.first..reloads.last * *update account set money = money + reloads(i).amount where account.id = reloads.acct_id; Can it happen, that two "trigger before insert or update on account for each row" are executing in parallel for the same record? - if acct_id = X is there multiple times in table reloads. So they will find the same ld conditions.Or does oracle take care for sequential execution of trigger for same record? - thanks! rgds, Frank |
#4
| |||
| |||
|
|
i have a problem for "before insert or update" trigger. Currently this trigger records old table X record in dedicated X_HIST table (same structure plus sequence counter). This is done with individual SQL insert into X_HIST table. I wanted to tune this. So instead of individual SQL insert i invoke a some_pkg.PushEntry(...) function. pl/sql package 'some_pkg' manages a collection to buffer given X records. When all my stuff is done, then i invoke a some_pkg.InsertEntries() to do a bulk insert. But for this i detect duplicates in the collection! I don't know why there are these duplicates. Do triggers "not play niceley" with pl/sql collections for this? It feels, like there are multiple invocations of trigger for the same X record. And it doesn't harm if i use the individual SQL insert into X_HIST table. But it's a problem if i try to delay SQL insert for bulk operation. |
#5
| |||
| |||
|
|
Hi, are triggers executed in parallel for parallel DML? What happens, if the same record is updated _twice_ in a bulk update? Something like this: forall i reloads.first..reloads.last * *update account set money = money + reloads(i).amount where account.id = reloads.acct_id; Can it happen, that two "trigger before insert or update on account for each row" are executing in parallel for the same record? - if acct_id = X is there multiple times in table reloads. So they will find the same ld conditions.Or does oracle take care for sequential execution of trigger for same record? - thanks! rgds, Frank |
#6
| |||
| |||
|
|
On Feb 16, 7:34*am, Frank Bergemann <FBergem... (AT) web (DOT) de> wrote: Hi, are triggers executed in parallel for parallel DML? What happens, if the same record is updated _twice_ in a bulk update? Something like this: forall i reloads.first..reloads.last * *update account set money = money + reloads(i).amount where account.id = reloads.acct_id; Can it happen, that two "trigger before insert or update on account for each row" are executing in parallel for the same record? - if acct_id = X is there multiple times in table reloads. So they will find the same ld conditions.Or does oracle take care for sequential execution of trigger for same record? - thanks! rgds, Frank Not directly answering your question but FORALL is not performing parallel DML, it is merely doing a bulk operation that minimizes the overhead of single row operations. I'm not aware of it being able to run in parallel DML mode. |
![]() |
| Thread Tools | |
| Display Modes | |
| |