Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1995

Re: Using sp_getapplock outside a transaction

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Using sp_getapplock outside a transaction
Date Wed, 29 Nov 2017 13:44:59 +0100
Organization Erland Sommarskog
Lines 21
Message-ID <XnsA83C8BDF17E95Yazorman@127.0.0.1> (permalink)
References <20171125145629.a8f9f75371e03662bf0496dd@gmail.com> <e7eeb2b3-4502-4512-a2c8-a20e908fa080@googlegroups.com> <20171125182411.7cc99cc41acef664ea224b1c@gmail.com> <XnsA838DBBEAC219Yazorman@127.0.0.1> <20171126194310.7f5514c0300678d88cf17eaa@gmail.com> <XnsA839CAC1E58E4Yazorman@127.0.0.1> <20171127113428.2629ecf62d24b8131d42d13f@g{oogle}mail.com> <XnsA83A797965E4BYazorman@127.0.0.1> <20171129152226.e1d2475ae9a71ee46b35b3cf@g{oogle}mail.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info reader02.eternal-september.org; posting-host="14dd4d0a4f872714f600efc5b94d7526"; logging-data="12623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/92fM6kHGAvciXB4qDayDp"
User-Agent Xnews/2006.08.24 Mime-proxy/1.4.c.4 (Win32)
Cancel-Lock sha1:uDEgynuRnfWyvxyL0S9QiTd5dEo=
Xref csiph.com comp.databases.ms-sqlserver:1995

Show key headers only | View raw


Anton Shepelev (anton.txt@g{oogle}mail.com) writes:
> What  about  error  handling?   In  the case of pure
> nesting I could simply ensure that every  BEGIN TRAN
> has  a  corresponding  COMMIT  or ROLLBACK, probably
> with the help of a TRY..CATCH block.  In the current
> model,  however, it is a tad less trivial, because I
> must test @@TRANCOUNT to see whether a  nested  call
> did  not  roll  back my transaction in the course of
> its own error handling logic.
> 

If you don't want to use TRY-CATCH, you need to write some tedious
piece of code.

On my web site there is a series of articles on error and transaction
handling in SQL Server, which starts here:
http://www.sommarskog.se/error_handling/Part1.html

If you want to do without TRY-CATCH, this is something I cover very 
little, except for the old articles for SQL 2000. (You find links to 
these if you go to the link above.)

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@gmail.com> - 2017-11-25 14:56 +0300
  Re: Using sp_getapplock outside a transaction rja.carnegie@gmail.com - 2017-11-25 05:37 -0800
    Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@gmail.com> - 2017-11-25 18:24 +0300
      Re: Using sp_getapplock outside a transaction rja.carnegie@gmail.com - 2017-11-25 08:36 -0800
        Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@gmail.com> - 2017-11-25 21:13 +0300
          Re: Using sp_getapplock outside a transaction rja.carnegie@gmail.com - 2017-11-25 16:21 -0800
      Re: Using sp_getapplock outside a transaction Erland Sommarskog <esquel@sommarskog.se> - 2017-11-25 21:36 +0100
        Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@gmail.com> - 2017-11-26 19:43 +0300
          Re: Using sp_getapplock outside a transaction Erland Sommarskog <esquel@sommarskog.se> - 2017-11-26 19:55 +0100
            Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@g{oogle}mail.com> - 2017-11-27 11:34 +0300
              Re: Using sp_getapplock outside a transaction Erland Sommarskog <esquel@sommarskog.se> - 2017-11-27 11:56 +0100
                Re: Using sp_getapplock outside a transaction rja.carnegie@gmail.com - 2017-11-27 14:23 -0800
                Re: Using sp_getapplock outside a transaction Erland Sommarskog <esquel@sommarskog.se> - 2017-11-28 08:50 +0100
                Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@g{oogle}mail.com> - 2017-11-29 15:11 +0300
                Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@g{oogle}mail.com> - 2017-11-29 15:22 +0300
                Re: Using sp_getapplock outside a transaction Erland Sommarskog <esquel@sommarskog.se> - 2017-11-29 13:44 +0100
                Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@g{oogle}mail.com> - 2017-11-29 18:44 +0300
                Re: Using sp_getapplock outside a transaction Anton Shepelev <anton.txt@g{oogle}mail.com> - 2017-11-29 19:42 +0300
                Re: Using sp_getapplock outside a transaction rja.carnegie@gmail.com - 2017-11-30 13:19 -0800

csiph-web