交易和锁定 [英] Transactions and Locking

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

问题描述

我对自动付款系统有一些要求。系统有四台机器设置如下:

1-两台机器有一个集群数据库。

2-两台机器有.net业务逻辑组件将处理

与某些外部组件的支付交易(支付网关)

我的查询是关于业务逻辑内的事务处理

零件。因为这个组件在两台机器上运行,而这些组件的两个实例正在访问相同的事务

表。我需要这两个组件一起工作而不会阻塞。

因此事务隔离级别序列化不适用于这个

型号。


我不清楚如何锁定特定的行

处理通过某种情况。如果我设置一个标志(列)来锁定行,

然后该实例可能会在重置标志之前失败,那么此行

将永远不会被处理。在这种情况下,我希望另一个

实例接管并处理以前由

其他实例锁定的内容。


有没有关于这些组件之间的安排的想法

访问同一张桌子?


非常感谢你的帮助,

Rami AlHasan

I have some requirement for an automated payment system. The system has
four machines setup as follows:
1- Two machines have a clustered database.
2- Two machines have a .net business logic component that will handle
payment transactions with certain external component (Payment Gateway)
My query is regarding transaction handling inside the business logic
component. Because this component is running on two machines and these
two instances of the component are accessing the same transactions
table. I need these two components to work together without blocking.
So transaction isolation level "Serialized" will not work with this
model.

I am not clear about how to lock the specific rows that are being
handled by certain instance. If I set a flag (column) to lock the row,
then that instance may fail before resetting the flag then this row
will never be handled. In such a scenario I would expect the other
instance to take over and handle whatever was locked previously by the
other instance.

Is there any ideas regarding arrangement between such components which
access the same table?

Thanks a lot for the help,
Rami AlHasan

推荐答案

Rami

查询有什么作用?事务UPDATE / INSEERT / DELETE操作吗?

表有多大?你是否在表格上定义了索引?


Rami < ra ********* @ gmail.comwrote in message

news:11 ********************* *@51g2000cwl.googlegro ups.com ...
Rami
What do the queries do? Do the transactions UPDATE/INSEERT/DELETE operation?
How big are the tables? Do you have indexes defined on the tables?

"Rami" <ra*********@gmail.comwrote in message
news:11**********************@51g2000cwl.googlegro ups.com...

>我对自动付款系统有一些要求。系统有四台机器设置如下:

1-两台机器有一个集群数据库。

2-两台机器有.net业务逻辑组件将处理

与某些外部组件的支付交易(支付网关)


我的查询是关于业务逻辑内的事务处理

组件。因为这个组件在两台机器上运行,而这些组件的两个实例正在访问相同的事务

表。我需要这两个组件一起工作而不会阻塞。

因此事务隔离级别序列化不适用于这个

型号。


我不清楚如何锁定特定的行

处理通过某种情况。如果我设置一个标志(列)来锁定行,

然后该实例可能会在重置标志之前失败,那么此行

将永远不会被处理。在这种情况下,我希望另一个

实例接管并处理以前由

其他实例锁定的内容。


有没有关于这些组件之间的安排的想法

访问同一张桌子?


非常感谢你的帮助,

Rami AlHasan
>I have some requirement for an automated payment system. The system has
four machines setup as follows:
1- Two machines have a clustered database.
2- Two machines have a .net business logic component that will handle
payment transactions with certain external component (Payment Gateway)
My query is regarding transaction handling inside the business logic
component. Because this component is running on two machines and these
two instances of the component are accessing the same transactions
table. I need these two components to work together without blocking.
So transaction isolation level "Serialized" will not work with this
model.

I am not clear about how to lock the specific rows that are being
handled by certain instance. If I set a flag (column) to lock the row,
then that instance may fail before resetting the flag then this row
will never be handled. In such a scenario I would expect the other
instance to take over and handle whatever was locked previously by the
other instance.

Is there any ideas regarding arrangement between such components which
access the same table?

Thanks a lot for the help,
Rami AlHasan



Rami:


我认为你的概念错误设计你需要检查
。你说你想要组件一起工作

而不阻塞,但你说你想要锁定一行。当你

" lock"一行,你基本上阻止另一个进程从

操作该行(这取决于锁的类型)。


-D


Rami写道:
Rami:

I think you have a conceptual error in your design that you need to
examine. You said that you want the components to work together
without blocking, yet you say that you want to lock a row. When you
"lock" a row, you essentially are blocking another process from
operating on that row (it depends on the type of lock).

-D

Rami wrote:

我对自动支付系统有一些要求。系统有四台机器设置如下:

1-两台机器有一个集群数据库。

2-两台机器有.net业务逻辑组件将处理

与某些外部组件的支付交易(支付网关)


我的查询是关于业务逻辑内的事务处理

组件。因为这个组件在两台机器上运行,而这些组件的两个实例正在访问相同的事务

表。我需要这两个组件一起工作而不会阻塞。

因此事务隔离级别序列化不适用于这个

型号。


我不清楚如何锁定特定的行

处理通过某种情况。如果我设置一个标志(列)来锁定行,

然后该实例可能会在重置标志之前失败,那么此行

将永远不会被处理。在这种情况下,我希望另一个

实例接管并处理以前由

其他实例锁定的内容。


有没有关于这些组件之间的安排的想法

访问同一张桌子?


非常感谢你的帮助,

Rami AlHasan
I have some requirement for an automated payment system. The system has
four machines setup as follows:
1- Two machines have a clustered database.
2- Two machines have a .net business logic component that will handle
payment transactions with certain external component (Payment Gateway)
My query is regarding transaction handling inside the business logic
component. Because this component is running on two machines and these
two instances of the component are accessing the same transactions
table. I need these two components to work together without blocking.
So transaction isolation level "Serialized" will not work with this
model.

I am not clear about how to lock the specific rows that are being
handled by certain instance. If I set a flag (column) to lock the row,
then that instance may fail before resetting the flag then this row
will never be handled. In such a scenario I would expect the other
instance to take over and handle whatever was locked previously by the
other instance.

Is there any ideas regarding arrangement between such components which
access the same table?

Thanks a lot for the help,
Rami AlHasan


感谢Uri,


是交易完成所有操作,如UPDATE / INSEERT / DELETE。表格

将快速增长,因为这些是支付交易。索引

是在WHERE子句中使用过多的列上定义的。


Uri Dimant写道:
Thanks Uri,

Yes transactions do all opertaions like UPDATE/INSEERT/DELETE. Tables
will be growing fast becuase these are payment transactions. Indexes
are defined on the columns used too much in WHERE clauses.

Uri Dimant wrote:

Rami

查询有什么作用?事务UPDATE / INSEERT / DELETE操作吗?

表有多大?你是否在表格上定义了索引?


Rami < ra ********* @ gmail.comwrote in message

news:11 ********************* *@51g2000cwl.googlegro ups.com ...
Rami
What do the queries do? Do the transactions UPDATE/INSEERT/DELETE operation?
How big are the tables? Do you have indexes defined on the tables?

"Rami" <ra*********@gmail.comwrote in message
news:11**********************@51g2000cwl.googlegro ups.com...

我对自动支付系统有一些要求。系统有四台机器设置如下:

1-两台机器有一个集群数据库。

2-两台机器有.net业务逻辑组件将处理

与某些外部组件的支付交易(支付网关)

我的查询是关于业务逻辑内的事务处理

零件。因为这个组件在两台机器上运行,而这些组件的两个实例正在访问相同的事务

表。我需要这两个组件一起工作而不会阻塞。

因此事务隔离级别序列化不适用于这个

型号。


我不清楚如何锁定特定的行

处理通过某种情况。如果我设置一个标志(列)来锁定行,

然后该实例可能会在重置标志之前失败,那么此行

将永远不会被处理。在这种情况下,我希望另一个

实例接管并处理以前由

其他实例锁定的内容。


有没有关于这些组件之间的安排的想法

访问同一张桌子?


非常感谢你的帮助,

Rami AlHasan
I have some requirement for an automated payment system. The system has
four machines setup as follows:
1- Two machines have a clustered database.
2- Two machines have a .net business logic component that will handle
payment transactions with certain external component (Payment Gateway)
My query is regarding transaction handling inside the business logic
component. Because this component is running on two machines and these
two instances of the component are accessing the same transactions
table. I need these two components to work together without blocking.
So transaction isolation level "Serialized" will not work with this
model.

I am not clear about how to lock the specific rows that are being
handled by certain instance. If I set a flag (column) to lock the row,
then that instance may fail before resetting the flag then this row
will never be handled. In such a scenario I would expect the other
instance to take over and handle whatever was locked previously by the
other instance.

Is there any ideas regarding arrangement between such components which
access the same table?

Thanks a lot for the help,
Rami AlHasan


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

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