Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
galit
Posts: 18
Joined: Mon 12 Feb 2007 11:07

Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock

Post by galit » Sun 28 Jun 2015 16:57

Hello

I use:
Delphi XE6
Win 7 64 bit
SDAC 7.1.4 Pro for Delphi XE6
SQL Server 2008 R2

In my program, I am using ‘prDirect’ provider of the TMSConnection, and i have SQLQuery of type TSDACMSQuery.

I set:

SQLQuery.SQL.Text := SQL;

where SQL equal to:

' DECLARE @ResourceName NVARCHAR(255) SET @ResourceName = N''LOUN_SO_92120414'' EXEC master.dbo.sp_getapplock @Resource = @ResourceName , @LockMode = Exclusive, @LockOwner = Session' (read=GetFinalSQL)

and then when i call to:
SQLQuery.Execute();

i get the following exception:

The following error has occurred in the application :
Exception class: 'Exception'
Exception message: 'Exception of class ''ETDSError'' has occured.
Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock@Resource@ResourceName,@LockModeExclusive,@LockOwnerSession''.'

In SDAC 6.10.20 for Delphi XE6 this didn't happen.

Please let me know how to solve this.

Thanks.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock

Post by azyk » Wed 01 Jul 2015 08:10

Thank you for the information. We have reproduced this problem and are investigating it. We will notify you about the results as any are available.

ysyang
Posts: 41
Joined: Tue 14 Jun 2005 09:10

Re: Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock

Post by ysyang » Sun 12 Jul 2015 09:18

if connection is Native mode, no problem but connection is Direct has problem.

Code: Select all

QTemp.Connection.options.provider = prNativeClient;
QTemp.Connection.Connect;

  With QTemp do
  begin
    Close;
    SQL.Clear;
    SQL.Add('EXEC sp_addextendedproperty N''MS_Description'',N''Date'',N''schema'',N''dbo'',N''table'',N''date_object''')
  end;
  QTemp.Open;

Successfully executed the command.

Code: Select all

QTemp.Connection.options.provider = prDirect;
QTemp.Connection.Connect;

  With QTemp do
  begin
    Close;
    SQL.Clear;
    SQL.Add('EXEC sp_addextendedproperty N''MS_Description'',N''Date'',N''schema'',N''dbo'',N''table'',N''date_object''')
  end;
  QTemp.Open;


The operation completed with errors.
I tried to trace in SQL Server Profiler and find problem.

original sql

Code: Select all

exec sp_addextendedproperty N'MS_Description',N'asdfasdf',N'schema',N'dbo',N'table',N'date_object11' 
changed sql

Code: Select all

exec sp_addextendedpropertyN'MS_Description',N'asdfasdf',N'schema',N'dbo',N'table',N'date_object11' 
exec sp_addextendedpropertyN'MS_Description',N'asdfasdf',N'schema',N'dbo',N'table',N'date_object11'
Perhaps the direct connection mode seems to be a bug.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock

Post by azyk » Wed 22 Jul 2015 08:14

We have reproduced these problems and fixed it. These fixes will be included into the next SDAC build.

ysyang
Posts: 41
Joined: Tue 14 Jun 2005 09:10

Re: Exception Message: Could not find stored procedure ''master.dbo.sp_getapplock

Post by ysyang » Mon 24 Aug 2015 07:18

In the source code you sent me the problem was solved.
Thank you very much

Post Reply