选择后提交 [英] commit after select
问题描述
对于DB2和MySQL,在select
语句后可能需要commit
的情况下,我已经阅读了以下说明:
I have read the explanations when a commit
may be neccessary after a select
statement for DB2 and MySQL:
我的问题是使用Oracle执行select
语句后,何时以及为什么对commit
重要?
My question is when and why would it be important to commit
after executing a select
statement using Oracle?
推荐答案
只有少数几种情况我可以想到,您可能希望在选择后提交.
there are only a few situations that I can think of that you may want to commit after a select.
-
如果您的选择正在加入数据库链接,则将创建一个事务.如果您尝试关闭此链接,除非提交/回滚了该交易,否则会收到错误消息.
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.
选择更新(如DCookie所述)以释放锁.
select for update (as DCookie says) to release the locks.
删除序列化隔离级别(如果已设置)或添加一个(如果您在调用此链接之前已从数据库链接中进行选择).
to remove an serialized isolation level if set or to add one, if you've been selecting from db links prior to invoking this.
这篇关于选择后提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!