Recent

Author Topic: Dataset already registered : "%s" SQLite  (Read 479 times)

lainz

  • Hero Member
  • *****
  • Posts: 3914
  • Leandro Diaz
Dataset already registered : "%s" SQLite
« on: April 09, 2019, 12:21:23 am »
I get this message, in the %s part I get just an empty string.

Message definition:
https://github.com/alrieckert/freepascal/blob/master/packages/fcl-db/src/base/dbconst.pas

Used in this unit in two places:
https://github.com/newpascal/freepascal/blob/master/packages/fcl-db/src/base/database.inc#L184

'RegisterDataset'
method.

Any ideas of what can generate this error?

Edit:

database.inc is on file DB.pas, that contains the class TDatabase, used by TSQLite3Connection (child of it).

Used in other class here

Code: Pascal  [Select][+][-]
  1. { ---------------------------------------------------------------------
  2.     TDBDataset
  3.   ---------------------------------------------------------------------}
  4.  
  5. Procedure TDBDataset.SetDatabase (Value : TDatabase);
  6.  
  7. begin
  8.   If Value<>FDatabase then
  9.     begin
  10.     CheckInactive;
  11.     If Assigned(FDatabase) then
  12.       FDatabase.UnregisterDataset(Self);
  13.     If Value<>Nil Then
  14.       Value.RegisterDataset(Self);
  15.     FDatabase:=Value;
  16.     end;
  17. end;
  18.  
  19. TDBDataset.SetTransaction (Value : TDBTransaction);
  20.  
  21. begin
  22.   CheckInactive;
  23.   If Value<>FTransaction then
  24.     begin
  25.     If Assigned(FTransaction) then
  26.       FTransaction.UnregisterDataset(Self);
  27.     If Value<>Nil Then
  28.       Value.RegisterDataset(Self);
  29.     FTransaction:=Value;
  30.     end;
  31. end;

It must be setting the database or setting the transaction... The problem is that this comes randomly and I can't debug this.
« Last Edit: April 09, 2019, 12:32:24 am by Lainz »

 

TinyPortal © 2005-2018