Tracking Error 266 in SQL Server 2005

Is there a way to trap error 266 inside JDBC or inside SQL by wrapping the exec statement somehow?

We strive to develop security around stored procedures that exit with a transaction that is open in the usual way. This helps prevent a programmer error that can cause significant problems in conjunction with the connection pool.

+3
source share
2 answers

Yes. Use SET XACT_ABORT ON.

It suppresses error 266 and also results in rollback under any circumstances, including client team timeouts that simply break.

, PerformanceDBA, .

:

+3
  • , 15000 IIRC, , . , , proc.

  • , SQL . - "" , , . ( ) . . ; 1205. , spid.

  • , , . , , . (, ) - .

  • . ( ), , . ( 40 ):

    • .
    • , .
    • ,
    • DML

    • ,
  • , ( ):

    • ( , )
    • , ,
      .
      , , , , , ; . , . , , , - , , , . ,
  • , , spid (, , ), . ANSI SQL 89 ( 92). . , ( ), "", SQL, , ; .

    , NO AUTOCOMMIT CHAINED, ANSI SQL. , () MS ​​ , () , .

  • , , , , ( , ), , , , , .

  • , , try/catch/finally, , , , try/catch . SQL-, , , . SQL - , , .

    , , () , , () , .

    , ...

+1

Source: https://habr.com/ru/post/1772756/


All Articles