View previous topic :: View next topic |
Author |
Message |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Wed Sep 22, 2004 9:57 am Post subject: Commit |
|
|
I know that I need a COMMIT in a program after updating rows in a table. If I only perform SELECT on a table, is COMMIT necessary or recommended? |
|
Back to top |
|
 |
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Wed Sep 22, 2004 11:00 am Post subject: |
|
|
If a large number of selects are performed commit is recommended else not required. thanks |
|
Back to top |
|
 |
a_seshu Beginner

Joined: 30 Sep 2004 Posts: 16 Topics: 4 Location: Chennai
|
Posted: Sat Oct 02, 2004 7:38 am Post subject: |
|
|
Suresh,
do you have any idea why is that we would be needing a COMMIT even after a large number of selects are performed? I mean i dont understand what might be the need for giving a commit, even when we are doing a pure read.
May be anything like db2 would release all the held resources for reading???  _________________ I dont think I would ever stop learning. - Seshu. |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Oct 04, 2004 6:59 am Post subject: |
|
|
DB2 holds ressources (i.e. locks) even during read processes depending on the "isolation level" of the used DB2 packages or DB2 plans.
If you are reading using the isolation level "Cursor Stability", which is a common used value, then the minimal ressources held have nothing to do with the number of selects you are issuing and giving COMMITs is obsolet.
If you, however, use "Repeatable Read", which is the DB2 default unless overridden by the user, then the ressource consumption is significant.
regards
Christian |
|
Back to top |
|
 |
|
|