Page 1 of 1

Bug in MyDAC 5.0.1.7

Posted: Fri 08 Jun 2007 12:05
by iad
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.

Posted: Fri 08 Jun 2007 14:36
by Antaeus
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.

Posted: Fri 08 Jun 2007 18:16
by iad
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.

Posted: Sun 10 Jun 2007 06:25
by iad
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.

Posted: Mon 11 Jun 2007 11:17
by Antaeus
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.

Posted: Mon 11 Jun 2007 11:20
by Antaeus
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.