commit after select

前端 未结 2 1114
忘了有多久
忘了有多久 2021-02-19 14:34

I have read the explanations when a commit may be neccessary after a select statement for DB2 and MySQL:

Is a commit needed on a select query i

2条回答
  •  我在风中等你
    2021-02-19 15:32

    there are only a few situations that I can think of that you may want to commit after a select.

    1. if your select is joining on database links, a transaction will be created. if you attempt to close this link, you'd get an error unless you committed/rolled back the transaction.

    2. select for update (as DCookie says) to release the locks.

    3. to remove an serialized isolation level if set or to add one, if you've been selecting from db links prior to invoking this.

提交回复
热议问题