如果只提交一个查询,有必要用事务吗?这个问题之前已经讨论过
但是并没有得出明确的结论。先让我们看看事务的定义:
引用:
Transactions are described in terms of ACID properties, which are as follows:
n Atomic: all changes to the database made in a transaction are rolled back if any
change fails.
n Consistent: the effects of a transaction take the database from one consistent
state to another consistent state.
n Isolated: the intermediate steps in a transaction are not visible to other users of
the database.
n Durable: when a transaction is completed (committed or rolled back), its effects
persist in the database.
即ACID的定义,从上面看来,似乎除了isolated之外,和只读查询都没有关系。那么是否只读查询不需要事务呢?
再看看Oracle对于只读事务的定义:
引用:
Read-Only Transactions
By default, Oracle guarantees statement-level read consistency. The set of data returned by a single q