![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm wondering, whether the "nobody ...." comment in the following sql file (which is called via "$>db2 -t -f sql") : $>cat sql -- BEGIN delete from NEW ; -- nobody should to read from NEW at this point insert into NEW (select * from OLD) ; --END could be removed or if it is possible that somebody could read from table NEW between the delete and insert statement. |
#3
| |||
| |||
|
|
"Toralf Förster"<toralf.foerster (AT) gmx (DOT) de> wrote in message news:i213mg$jf4$1 (AT) news (DOT) eternal-september.org... I'm wondering, whether the "nobody ...." comment in the following sql file (which is called via "$>db2 -t -f sql") : $>cat sql -- BEGIN delete from NEW ; -- nobody should to read from NEW at this point insert into NEW (select * from OLD) ; --END could be removed or if it is possible that somebody could read from table NEW between the delete and insert statement. Auto-commit is on by default, so commit happens after every statement. Aside from that in DB2 9.7 CURRENTLY COMMITTED for CS ISOLATION is on by |
#4
| |||
| |||
|
|
Aside from that in DB2 9.7 CURRENTLY COMMITTED for CS ISOLATION is on by default for all new databases. So there can be concurrent queries. These concurrent queries will see the "deleted" rows until the delete is committed. They will not see any INSERTed rows until that is committed. Thx, |
#5
| |||
| |||
|
|
On 7/19/2010 7:57 PM, Mark A wrote: "Toralf Förster"<toralf.foers... (AT) gmx (DOT) de> *wrote in message news:i213mg$jf4$1 (AT) news (DOT) eternal-september.org... I'm wondering, whether the "nobody ...." comment in the following sql file (which is called via "$>db2 -t -f sql") : $>cat sql -- BEGIN * * * * * * * * delete from NEW * * * * * * * * ; -- nobody should to read from NEW at this point * * * * * * * * insert into NEW (select * from OLD) * * * * * * * * ; --END could be removed or if it is possible that somebody could read from table NEW between the delete and insert statement. Auto-commit is on by default, so commit happens after every statement. Aside from that in DB2 9.7 CURRENTLY COMMITTED for CS ISOLATION is on by default for all new databases. So there can be concurrent queries. These concurrent queries will see the "deleted" rows until the delete is committed. They will not see any INSERTed rows until that is committed. Cheers Serge -- Serge Rielau SQL Architect DB2 for LUW IBM Toronto Lab- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
indeed this was a feature. Our developer told me that he has to rewrite all procedure after upgrading to 9.7 and activate CURRENTLY COMMITTED , to do a commit after each sql. Is this true? I'm not sure I follow. |
![]() |
| Thread Tools | |
| Display Modes | |
| |