[20131014] 出现错误,显示事务没有回滚
[20131014] 出现错误,显示事务没有回滚 测试代码: TRY DELETE dbo.T TRY BEGIN CATCH CATCH COMMIT /* 问题:1.SELECT * FROM [不存在的表] 为什么会直接跳出,不完成事务?2.SELECT * FROM [不存在的表] 是否属于编译错误?3.修改为SET XACT_ABORT ON 可以回
[20131014] 出现错误,显示事务没有回滚
测试代码:
TRY DELETE dbo.T TRY BEGIN CATCH CATCH COMMIT /*问题: 1.SELECT * FROM [不存在的表] 为什么会直接跳出,不完成事务? 2.SELECT * FROM [不存在的表] 是否属于编译错误? 3.修改为SET XACT_ABORT ON 可以回滚,如果SELECT * FROM [不存在的表]是编译错误 那么联机文档中:编译错误(如语法错误)不受 SET XACT_ABORT 的影响。如何解释? */
问题:
在一个session中运行以上代码,然后在另外一个session运行 select * from T,发现select语句被堵塞
原因:
sql 编译的流程 Parse->Bind->Optimize->Execute
一般认为从Parse到Optimize 是编译阶段,,Execute是执行阶段
猜测try catch不会再Bind和Optimize阶段出现的错误进行捕获,以上出现的错误可能不被认为是编译错误,所以,使用 xact 为on是可以成功自动回滚
解决方法:
使用 SET XACT_ABORT ON 来回滚事物
posted on

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

If you encounter an error message when using your printer, such as the operation could not be completed (error 0x00000771), it may be because the printer has been disconnected. In this case, you can solve the problem through the following methods. In this article, we will discuss how to fix this issue on Windows 11/10 PC. The entire error message says: The operation could not be completed (error 0x0000771). The specified printer has been deleted. Fix 0x00000771 Printer Error on Windows PC To fix Printer Error the operation could not be completed (Error 0x0000771), the specified printer has been deleted on Windows 11/10 PC, follow this solution: Restart Print Spool

Table of Contents Solution 1 Solution 21. Delete the temporary files of Windows update 2. Repair damaged system files 3. View and modify registry entries 4. Turn off the network card IPv6 5. Run the WindowsUpdateTroubleshooter tool to repair 6. Turn off the firewall and other related anti-virus software. 7. Close the WidowsUpdate service. Solution 3 Solution 4 "0x8024401c" error occurs during Windows update on Huawei computers Symptom Problem Cause Solution Still not solved? Recently, the web server needs to be updated due to system vulnerabilities. After logging in to the server, the update prompts error code 0x8024401c. Solution 1

LinuxOops: Detailed explanation of the meaning of this error, need specific code examples What is LinuxOops? In Linux systems, "Oops" refers to a situation where a serious error in the kernel causes the system to crash. Oops is actually a kernel crash mechanism that stops the system when a fatal error occurs and prints out relevant error information so that developers can diagnose and fix the problem. Oops usually occur in kernel space and have nothing to do with user space applications. When the kernel encounters

The display error is a problem that may occur in the Xiangxiang Fuzhai app. Some users are not sure why the Xiangxiang Fuzhai app displays errors. It may be due to network connection problems, too many background programs, incorrect registration information, etc. Next, This is the editor’s introduction to how to solve app display errors for users. Interested users should come and take a look! Why does the Xiangxiang Fuzhai app display an error answer: network connection problem, too many background programs, incorrect registration information, etc. Details: 1. [Network problem] Solution: Check the device connection network status, reconnect or choose another network connection to use. Can. 2. [Too many background programs] Solution: Close other running programs and release the system, which can speed up the running of the software. 3. [Incorrect registration information
![Streaming server throws error [FIXED]](https://img.php.cn/upload/article/000/465/014/171133083740341.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
Are you getting a streaming server throwing an error on your computer? Stremio is a cross-platform video streaming service that you can use to stream and watch movies, TV shows, live TV, and more. Some users have reported getting this error when trying to launch the application. Errors can occur under a variety of circumstances, including Internet and server issues. This error may also be encountered when using the web version of Stremio. Interference from antivirus software or firewalls can also cause errors to occur. Whatever the case, you can fix the problem with this guide. Streaming Server Throws Error While running Stremio application on Windows, you may encounter “Stremio Streaming Server threw error

Title: Analysis of Oracle Error 3114: Causes and Solutions When using Oracle database, you often encounter various error codes, among which error 3114 is a relatively common one. This error generally involves database link problems, which may cause exceptions when accessing the database. This article will interpret Oracle error 3114, discuss its causes, and give specific methods to solve the error and related code examples. 1. Definition of error 3114 Oracle error 3114 pass

MySQL transaction processing: the difference between automatic submission and manual submission. In the MySQL database, a transaction is a set of SQL statements. Either all executions are successful or all executions fail, ensuring the consistency and integrity of the data. In MySQL, transactions can be divided into automatic submission and manual submission. The difference lies in the timing of transaction submission and the scope of control over the transaction. The following will introduce the difference between automatic submission and manual submission in detail, and give specific code examples to illustrate. 1. Automatically submit in MySQL, if it is not displayed

Recently, Samsung Display and Microsoft signed an important cooperation agreement. According to the agreement, Samsung Display will develop and supply hundreds of thousands of OLEDoS panels for mixed reality (MR) head-mounted devices to Microsoft. Microsoft is developing an MR device for multimedia content such as games and movies. This device is expected to It will be launched after the OLEDoS specifications are finalized, mainly serving the commercial field, and is expected to be delivered as early as 2026. OLEDoS (OLED on Silicon) technology OLEDoS is a new display technology that deposits OLED on a silicon substrate. Compared with traditional glass substrates, it is thinner and has higher pixels. OLEDoS display and ordinary display
