Problem with MemData.StopWaitProc

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
horsi
Posts: 14
Joined: Sat 15 Jan 2011 07:19

Problem with MemData.StopWaitProc

Post by horsi » Thu 24 Feb 2011 10:42

We lack the hourglass cursor when opening/executing queries/stored procedures. We searched the source code and found StartWaitProc and StopWaitProc in MemData module.

Code: Select all

procedure AppStartWait;
begin
  Screen.Cursor := crSQLWait
end {AppStartWait};

procedure AppStopWait;
begin
  Screen.Cursor := crDefault
end {AppStopWait};

initialization
  MemData.StartWaitProc := @AppStartWait;
  MemData.StopWaitProc := @AppStopWait;
Unfortunately, the above functionality is not working properly.
Please look at the code below:

Code: Select all

var
  lQuery: TUniQuery;
  lSP: TUniStoredProc;
begin
  [..]
  lQuery.SQL.Text := 'SELECT * FROM SOME_TABLE WHERE SOME_FIELD = :SOME_FIELD';
  lQuery.ParamByName('SOME_FIELD').AsInteger := 1;
  lQuery.Prepare;
  lQuery.Open; //<- Cursor remains as crSQLWait
  [..]
  lSP.Execute; //<- Cursor remains as crSQLWait
Opening/executeing query; executing Stored Procedure doesn't execute StopWaitProc.
Is this a bug?

--
License number: 00852.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 24 Feb 2011 11:09

Hello,

Please specify the exact version of UniDAC.

horsi
Posts: 14
Joined: Sat 15 Jan 2011 07:19

Post by horsi » Thu 24 Feb 2011 13:47

AlexP wrote:Please specify the exact version of UniDAC.
Despite we have valid subscription (and access to the latest version) we still works with 3.00.0.11.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 24 Feb 2011 15:13

Hello,

There are no AppStartWait and AppStopWait methods in the original MemData.pas file, and the initialization section looks like:

initialization
StartWaitProc := nil;
StopWaitProc := nil;

You can compare your MemData.pas with the original one (you can get it from the archive at secure*devart*com). If you changed the source code, try to replace your MemData.pas with the original one and rebuild UniDAC. The problem should disappear after this.

To make cursor change to crSQLWait on executing procedures/queries, you should add the UniDACVcl unit to the Uses section of any unit of the application.
Last edited by AlexP on Wed 18 Apr 2012 08:41, edited 1 time in total.

horsi
Posts: 14
Joined: Sat 15 Jan 2011 07:19

Post by horsi » Thu 24 Feb 2011 16:03

AlexP wrote:There are no AppStartWait and AppStopWait methods in the original MemData.pas file, and the initialization section looks like:

initialization
StartWaitProc := nil;
StopWaitProc := nil;

You can compare your MemData.pas with the original one (you can get it from the archive at secure*devart*com). If you changed the source code, try to replace your MemData.pas with the original one and rebuild UniDAC. The problem should disappear after this.

To make cursor change to crSQLWait on executing procedures/queries, you should add the UniDACVcl unit to the Uses section of any unit of the application.
Sorry, I had a badly expressed.
Of course, that the module MemData.pas doesn't containt AppStartWait and AppStopWait procedures.

It contain only function variables: StartWaitProc and StopWaitProc.

The first code shows a fragment of my module.

Code: Select all

unit uSomeTests;

interface

implementation

uses
  MemData, Controls, Forms;

procedure AppStartWait;
begin
  Screen.Cursor := crSQLWait
end {AppStartWait};

procedure AppStopWait;
begin
  Screen.Cursor := crDefault
end {AppStopWait};

initialization
  MemData.StartWaitProc := @AppStartWait;
  MemData.StopWaitProc := @AppStopWait;
end.
We want to restore the behavior similar to that offered by BDE.
We want to hourglass cursor back when opening/executing queries/stored procedures.

And the previously presented code:

Code: Select all

var
  lQuery: TUniQuery;
  lSP: TUniStoredProc;
begin
  [..]
  lQuery.SQL.Text := 'SELECT * FROM SOME_TABLE WHERE SOME_FIELD = :SOME_FIELD';
  lQuery.ParamByName('SOME_FIELD').AsInteger := 1;
  lQuery.Prepare;
  lQuery.Open; //<- Cursor remains as crSQLWait
  [..]
  lSP.Execute; //<- Cursor remains as crSQLWait
was intended to show that there is something wrong.
Uff, :wink:

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 25 Feb 2011 10:39

hello,

As I wrote you earlier, to make cursor change on executing procedures/queries, you should only add the UniDACVcl unit to the Uses section.

In some cases we don't call the Start/Stop methods and just change the cursor, that's why there may be no call for these methods and the appearance of the cursor won't change.

horsi
Posts: 14
Joined: Sat 15 Jan 2011 07:19

Post by horsi » Mon 28 Feb 2011 06:48

AlexP wrote:As I wrote you earlier, to make cursor change on executing procedures/queries, you should only add the UniDACVcl unit to the Uses section.
Indeed, adding the UniDacVcl.pas module solves our problem.
Thank you very much!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 28 Feb 2011 07:15

Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.

Post Reply