Jacek Laskowski 57 Posted March 12, 2020 (edited) I have a strange problem with FireDAC (Delphi 10.3.2) I create TFDMemTable dynamically, then I create its structure and index on base key (by memTable.Indexes.Add()). Next, I import data from JSON file (saved previously by TFDQuery object): memTable.LoadFromStream(x, sfJSON); AV is raised in this FD code: procedure TFDDatSView.RemRef; begin FRefs.RemRef; end; And on this import I get access violation in FireDAC code, because internal TFDDatSView field is nil (see attached screenshot)! When I remove the creation of the index there is no error. But I can't do it, because it's part of a big, generic mechanism and it's needed. The index is created when MemTable is in dsInactive mode, can it be the cause? I also noticed that when I do Open/Close this MemTable, there is no error either. What is the cause and how to avoid it without performing spells (like close/open)? Edited March 12, 2020 by Jacek Laskowski Share this post Link to post
Jacek Laskowski 57 Posted March 13, 2020 OK, the problem is not in FireDAC, but in the code associated with Spring4D. Injected interface for reasons I don't know yet reduces the reference counter to zero and is released, and with it FD objects. Share this post Link to post