search
Homephp教程php手册分布式查询和分布式事务

分布式查询和分布式事务

Jun 13, 2016 am 10:05 AM
sqlandaffairsdistributedcreateandserverInquireofLink

Microsoft® SQL Server™ 允许创建与称为链接服务器的 OLE DB 数据源的链接。在链接到 OLE DB 数据源之后,可以:
从 OLE DB 数据源引用行集,作为 Transact-SQL 语句中的表。
将命令传递给 OLE DB 数据源,并包含结果行集,作为 Transact-SQL 语句中的表。
 每个分布式查询都可以引用多个链接的服务器,而且可以对每个链接的服务器分别执行更新或读取操作。单个分布式查询可以对某些链接的服务器执行读取操作,并且对其它链接的服务器执行更新操作。通常情况下,每当某个事务可能更新多个链接服务器中的数据时,Microsoft SQL Server 都要求相应的 OLE DB 提供程序支持分布式事务。因此,链接服务器上所支持的查询类型取决于 OLE DB 提供程序中对事务的支持级别。OLE DB 为事务管理定义了两个可选的接口:
ITransactionLocal 支持 OLE DB 数据源中的本地事务。
ITransactionJoin 允许提供程序联结包含其它资源管理器的分布式事务。
所有支持 ITransactionJoin 的提供程序也都支持 ITransactionLocal。
如果在连接是自动提交模式时执行分布式查询,则应用以下规则:
对于不支持 ItransactionLocal 的提供程序,只允许执行读取操作。
对于支持 ITransactionLocal 的提供程序,允许执行所有更新操作。
主控 SQL Server 会自动调用每个参与更新操作的链接的服务器中的 ITransactionLocal,以启动本地事务,并在语句执行成功时提交或在语句执行失败时回滚。
如果分布式查询是针对分布式分区视图或者是在连接为显式或隐性事务时执行,则应用下列规则:
对于不支持 ITransactionJoin 的提供程序,只允许执行读取操作。不支持任何事务或只支持 ITransactionLocal 的提供程序不能参与更新操作。
如果 SET XACT_ABORT 设置为 ON,则对于支持 ITransactionJoin 的任意提供程序都允许执行所有的更新操作。主控 SQL Server 会自动调用每个参与更新操作的链接服务器中的 ITransactionJoin,以便在分布式事务中登记该服务器。然后当主控服务器表示要提交或回滚事务时,MS DTC 将提交或者回滚。
如果 SET XACT_ABORT 设置为 OFF,则链接服务器还必须支持嵌套事务,才能对其执行更新操作。当会话已经有一个现有事务时,如果提供程序支持调用 ITransactionLocal::StartTransaction,则支持嵌套事务。这使 SQL Server 得以回滚分布式查询中的单个语句,而不是回滚整个事务。
上述规则意味着提供程序的下列限制不支持嵌套事务:仅在 XACT_ABORT 选项设置为 ON 时,分布式事务中才允许更新操作。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function