Page 1 of 1

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

Posted: Sun 28 Jun 2015 16:57
by galit
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.

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

Posted: Wed 01 Jul 2015 08:10
by azyk
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.

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

Posted: Sun 12 Jul 2015 09:18
by ysyang
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.

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

Posted: Wed 22 Jul 2015 08:14
by azyk
We have reproduced these problems and fixed it. These fixes will be included into the next SDAC build.

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

Posted: Mon 24 Aug 2015 07:18
by ysyang
In the source code you sent me the problem was solved.
Thank you very much