Could not serialize - transaction aborted

Could not serialize - transaction aborted

I am running into the "Could not serialize - transaction aborted". It happens when I am updating a table.

两个进程同事更改一个表,报错!

Netezza does not support row level locking.
Only 1 process can modify data in a table at the same time.
You will always get 'could not serialize' errors
when you put the modification in a transaction block and
multiple processes try to modify a table at the same time:


begin;

update table foo set ...;

commit;

If two sessions execute the commands above, even if they are updating different rows,
 one of them is going to fail (assuming the SQL runs long enough so that both sessions
 update the table at the same time).
If you do not put the update statement in a begin/commit block,
you can have multiple sessions updating at the same time but they will get serialized.
 That is in general not a good design pattern though and I cannot recommened it
 as a way to update anything that is important (fine for log tables, bad for dimension and fact tables).

 

你可能感兴趣的:(transaction,-,Serialize,could,aborted,Netezza,not)