关于提交的问题 [英] Question about commit

查看:70
本文介绍了关于提交的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对oracle提交和事务有疑问。以下场景:


进程A在表中执行单个sql-INSERT并提交

事务。然后他通知进程B(ipc)读取新日期。所以

流程B开始选择......但是没有得到之前插入的

行。提交和选择之间的时间间隔非常短。

(注意:使用两个不同的会话)


问题:

1 。)从通话返回时提交确保所有其他会话/交易都可以立即看到所有更改吗?

2.)提交确保只有所有数据都是存储持久性,但

更改是否可以延迟到其他交易?

3.)可以选择...导致问题?除了dml语句之外,

select不会启动事务。将选择更新相反

解决问题?


问候markus

I have a question about oracle commit and transactions. Following scenario:

Process A performs a single sql-INSERT into a table and commits the
transaction. Then he informs process B (ipc) to read the new date. So
process B starts "select ..." but does not get the previously inserted
row. The timespan between commit and select is very short.
(NOTE: two different sessions are used)

Questions:
1.) Does commit when returning from call ensure, that all changes are
immediatelly visible to all other Sessions/transactions?
2.) Does commit ensure only that all data is stored persistent, but
changes are deferred visible to other transactions?
3.) May the "select ..." cause the problem? Other than dml statements a
select does not start a transaction. Would "select for update" instead
solve the problem?

regards markus

推荐答案



" Markus Breuer" <毫安*********** @ gmx.de>在消息中写道

news:ci ********** @ pentheus.materna.de ...

|我有一个关于oracle提交和事务的问题。以下

场景:

|

|进程A在表中执行单个sql-INSERT并提交

|交易。然后他通知进程B(ipc)读取新日期。所以

|过程B开始选择......。但是没有得到之前插入的

|行。提交和选择之间的时间间隔非常短。

| (注意:使用两个不同的会话)

|

|问题:

| 1.)从通话返回时提交确保所有更改都是

|所有其他会话/交易都可以立即看到吗?

| 2.)提交只确保所有数据都是持久存储的,但是

|其他交易可以推迟更改?

| 3.)可以选择选择......。导致问题?除了dml语句之外还有一个
| select不会启动事务。将选择更新相反

|解决问题?

|

|关于markus


提交完成事务,然后将控制权返回给发出的

应用程序,并且数据立即可供所有其他用户使用

特权


是从视图中选择的第二个流程?

你有VPD政策吗?

更多有关进程和SQL的详细信息将有所帮助。可能

版本也会有所帮助


++ mcs

"Markus Breuer" <ma***********@gmx.de> wrote in message
news:ci**********@pentheus.materna.de...
| I have a question about oracle commit and transactions. Following
scenario:
|
| Process A performs a single sql-INSERT into a table and commits the
| transaction. Then he informs process B (ipc) to read the new date. So
| process B starts "select ..." but does not get the previously inserted
| row. The timespan between commit and select is very short.
| (NOTE: two different sessions are used)
|
| Questions:
| 1.) Does commit when returning from call ensure, that all changes are
| immediatelly visible to all other Sessions/transactions?
| 2.) Does commit ensure only that all data is stored persistent, but
| changes are deferred visible to other transactions?
| 3.) May the "select ..." cause the problem? Other than dml statements a
| select does not start a transaction. Would "select for update" instead
| solve the problem?
|
| regards markus

the commit completes the transaction before returning control to the issuing
application, and the data is immediately available to all other users with
privileges

is the second process selecting from a view?
do you have VPD policies?
some more details about the processes and SQL involved would help. likely
the version would also be helpful

++ mcs


Mark C. Stock写道:
Mark C. Stock wrote:
" Markus Breuer" <毫安*********** @ gmx.de>在消息中写道
新闻:ci ********** @ pentheus.materna.de ...
|我有一个关于oracle提交和事务的问题。以下
情景:
|
|进程A在表中执行单个sql-INSERT并提交
|交易。然后他通知进程B(ipc)读取新日期。所以
|过程B开始选择......。但是没有得到以前插入的
|行。提交和选择之间的时间间隔非常短。
| (注意:使用两个不同的会话)
|
|问题:
| 1.)从通话返回时提交确保所有更改都是
|所有其他会话/交易立即可见?
| 2.)提交是否仅确保所有数据都是持久存储的,但是
|其他交易可以推迟更改?
| 3.)可以选择选择......。导致问题?除了dml语句之外还有一个
| select不会启动事务。将选择更新相反
|解决问题?
|
|关于markus

提交完成事务,然后将控制权交还给发布的
应用程序,并且所有其他用户都可以立即获得数据

>是从视图中选择的第二个过程?


从表中选择和形成视图之间有什么区别吗?

我们的流程直接访问表格。

do你有VPD政策?


我不知道VPD意味着什么......

关于进程的更多细节和涉及的SQL会有所帮助。可能
该版本也会有所帮助
"Markus Breuer" <ma***********@gmx.de> wrote in message
news:ci**********@pentheus.materna.de...
| I have a question about oracle commit and transactions. Following
scenario:
|
| Process A performs a single sql-INSERT into a table and commits the
| transaction. Then he informs process B (ipc) to read the new date. So
| process B starts "select ..." but does not get the previously inserted
| row. The timespan between commit and select is very short.
| (NOTE: two different sessions are used)
|
| Questions:
| 1.) Does commit when returning from call ensure, that all changes are
| immediatelly visible to all other Sessions/transactions?
| 2.) Does commit ensure only that all data is stored persistent, but
| changes are deferred visible to other transactions?
| 3.) May the "select ..." cause the problem? Other than dml statements a
| select does not start a transaction. Would "select for update" instead
| solve the problem?
|
| regards markus

the commit completes the transaction before returning control to the issuing
application, and the data is immediately available to all other users with
privileges

is the second process selecting from a view?
Is there any difference between selecting from a table and form a view?
Our processes directly access the table.
do you have VPD policies?
I dont know what VPD means...
some more details about the processes and SQL involved would help. likely
the version would also be helpful




我们在版本8.1.7.4和9.2.0.5中使用Oracle。两者都显示相同的

问题。 Application是使用oracle oci用c ++编写的。

描述的进程A和B是同一进程中的线程。但是

应该没有什么区别。


主要问题是:oracle是否确保返回的提交使得

更改立即可用于所有其他会话。并且:当使用简单的select语句时,是否可以使用
作为限制? =>选择确实

没有开始自己的交易。


关于markus



We use a Oracle in the Versions 8.1.7.4 and 9.2.0.5. Both show the same
problem. The Application is written in c++ using the oracle oci. The
described processes A and B are threads within the same process. But
that should not make a difference.

The main Question is: Does oracle ensure that a returned commit makes
changes immediatelly available to all other sessions. And: could there
be an restriction when using simple select statements? => select does
not start its own transaction.

regards markus


Markus Breuer< ma ***********@gmx.de>写在

新闻:ci ********** @ pentheus.materna.de:
Markus Breuer <ma***********@gmx.de> wrote in
news:ci**********@pentheus.materna.de:
我有一个关于oracle提交的问题交易。以下
场景:

进程A在表中执行单个sql-INSERT并提交
事务。然后他通知进程B(ipc)读取新日期。


在发出SELECT之前听起来很奇怪,

流程B需要发出一个COMMIT。


我怀疑这会让流程B看到新数据。

所以
进程B开始选择......但是没有获得之前插入的行。提交和选择之间的时间间隔非常短。
(注意:使用两个不同的会话)

问题:
1.)从通话返回时提交确保,所有所有其他会话/交易都可以立即看到更改吗?
2.)提交是否仅确保所有数据都是持久存储的,但是其他交易是否可以推迟更改?
3.)可以选择选择......。导致问题?除了dml语句之外
select不会启动事务。将选择更新而不是解决问题?

关于markus
I have a question about oracle commit and transactions. Following
scenario:

Process A performs a single sql-INSERT into a table and commits the
transaction. Then he informs process B (ipc) to read the new date.
As strange as this may sound PRIOR to issuing the SELECT,
Process B needs to issue a COMMIT.

I suspect that this will allow Process B to "see" the new data.
So
process B starts "select ..." but does not get the previously inserted
row. The timespan between commit and select is very short.
(NOTE: two different sessions are used)

Questions:
1.) Does commit when returning from call ensure, that all changes are
immediatelly visible to all other Sessions/transactions?
2.) Does commit ensure only that all data is stored persistent, but
changes are deferred visible to other transactions?
3.) May the "select ..." cause the problem? Other than dml statements
a select does not start a transaction. Would "select for update"
instead solve the problem?

regards markus






这篇关于关于提交的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆