Bug in MyDAC 5.0.1.7

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
iad
Posts: 34
Joined: Fri 24 Nov 2006 07:38

Bug in MyDAC 5.0.1.7

Post by iad » Fri 08 Jun 2007 12:05

GUys,
There is a bug in MyDAC 5.0.1.7
My code looks like that:

tableMain:=TMyTable.Create(nil);
tableMain.TableName:='signalsrelay';

try
tableMain.Connection:=mainMySQLServer ;
tableMain.Open;
if tableMain.RecordCount > 0 then
begin
tableMain.LockTable(ltWrite);
tableMain.SQL.Text:='Select * From signalsrelay';
tableMain.Execute;
for i := 1 to tableMain.RecordCount do
begin
tableMain.RecNo:=i;
new (rec);
rec.from:=tableMain.FieldByName('Provider').AsString;
rec.subject:=tableMain.FieldByName('Subject').AsString;
rec.content:=tableMain.FieldByName('Content').AsString;
commandsList.Add(rec);
end;
tableMain.SQL.Text:='Delete From signalsrelay';
tableMain.Execute;
tableMain.UnLockTable;

end;

except on E: Exception do
begin
AddError(error,'(ReadCommands) Exception - '+E.Message);
tableMain.UnLockTable;
end;
end;


In some time suddenly i get execption

FUpdateQuery = nil. StatementTypes = 128 (D:\Projects\Delphi\Dac\Source\DBAccess.pas, line 5168)

and then all the time this exception:

Not enough timers available
Not enough timers available

all the time.


this is not happening in 5.0.4 version.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 08 Jun 2007 14:36

You should not use the SQL property of the TMyTable class directly. Use TMyQuery instead.

I tried to reproduce this problem but with no success. Please send me a complete small sample at evgeniyD*crlab*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- exact version of Delphi, C++Builder or Kylix;
- exact version of MySQL server and MySQL client. You can see it in the Info sheet of TMyConnection Editor.

iad
Posts: 34
Joined: Fri 24 Nov 2006 07:38

Post by iad » Fri 08 Jun 2007 18:16

1. TmyQuery is not support locking and this is what i need- correct me if i wrong.
2. this problem not happening all the time. the actual code is running as a procedure in a loop in 500 ms interval. try to to run it like that and you will see.

iad
Posts: 34
Joined: Fri 24 Nov 2006 07:38

Post by iad » Sun 10 Jun 2007 06:25

More info:
1. it happens in Windows 2003,
2. it happens when two applications ( the same code) is running in parallel.
3. seems to be the problem with the locking mechanizm.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 11 Jun 2007 11:17

iad wrote:1. TmyQuery is not support locking and this is what i need- correct me if i wrong.
The Lock and LockTable methods are implemented in the TCustomMyDataSet class, which is an ancestor for both TMyTable and TMyQuery. So you can use locking in both classes.
iad wrote:2. this problem not happening all the time. the actual code is running as a procedure in a loop in 500 ms interval. try to to run it like that and you will see.
I did that but it looks like the program is running successfully.

Unfortunately we will not be able to fix this problem if we do not have enough information to reproduce it.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 11 Jun 2007 11:20

iad wrote:More info:
1. it happens in Windows 2003,
2. it happens when two applications ( the same code) is running in parallel.
3. seems to be the problem with the locking mechanizm.
Two applications are also running sucesfully.

Post Reply