Assertion failure

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
k&k
Posts: 4
Joined: Mon 07 Jun 2010 13:30

Assertion failure

Post by k&k » Mon 07 Jun 2010 13:57

I have a simple table with three columns. When I adding first record I get an error: Assertion failure: (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, line 2651).

Code: Select all

MSTransaction.AddConnection(MSConnection);
MSTransaction.StartTransaction;
if MSTransaction.Active
   then begin
     with MSQuery do
     begin
       LockTable(ltExclusive);
       RefreshRecord;
       Append;
       ...
       Post;
       RefreshRecord;
     end;
     MSTransaction.Commit;
     MSTransaction.RemoveConnection(MSConnection);
   end
   else begin
     MSTransaction.RemoveConnection(MSConnection);
   end;
Line LockTable(ltExclusive) generate an error. When adding second and next records, everything is OK.
Version Info: SDAC 4.80.0.58, RAD Studio 2007 Version 11.0.2902.10471, SQL Server 2008 R2 10.50.1600.1
Do you have any suggestions.

Regards
k&k

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 08 Jun 2010 08:58

I can not reproduce the problem.
Please try replacing MSTransaction.StartTransaction with MSConnection.StartTransaction and check if the problem still exists.

k&k
Posts: 4
Joined: Mon 07 Jun 2010 13:30

Post by k&k » Tue 08 Jun 2010 11:05

Unfortunately, it's still the same.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 08 Jun 2010 13:07

You should open the query before executing LockTable.
If it doesn't solve the problem, please compose a small sample to demonstrate the problem and send it to dmitryg*devart*com, including script to create database objects.

k&k
Posts: 4
Joined: Mon 07 Jun 2010 13:30

Post by k&k » Wed 09 Jun 2010 09:06

I sent a sample.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 09 Jun 2010 13:12

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next SDAC build.

Post Reply