Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Insert into hold lock and never release.

$
0
0

First off ... you *can* commit the tran in the stored proc, but it requires you understand a) (nested) transaction management and b) when running in chained mode a 'commit tran' is (in essence) automatically followed by a 'begin tran'.

 

As for a workaround ... welllll ... you could implement a bit of a kludge by disabling/re-enabling chained mode within your proc, eg:

 

================================

create proc <proc_name>

...

as

declare @tranchained tinyint

 

select @trainchained = @@tranchained

 

if @trainchained = 1

begin

   commit tran

   set chained off

end

 

... body of proc ...

 

if @tranchained = 1

     set chained on

go

sp_procxmode <proc_name>,anymode

go

================================

 

Obviously (?) if you exit the proc with re-enabling chained mode you could wreak havoc with the application (if it's assuming you're running in chained mode).


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>