You are not logged in.
Hi,
Imagine the next scenario :
Pseudo Code :
type
DiskDatabase = TSQLRestServerDB;
MemDatabase = TSQLRestServerFullMemory;
TName = class(TSQLRecord)
private
fnam : RawUTF8;
published
property Nam : RawUTF8 read fnam write fnam;
end;
end;
Two database context with one SQLRecord class inside (Two Databases share the same model). No problems here.
Suppose this :
var
Nam : TName;
MemoryContext : TSQLRestServerFullMemory;
DiskContext : TSQLRestServerDB;
begin
//Create two context one from memory and another from disk file and search one TName record on Memory (we added one) database (WHERE Name = Turrican)
//... Context creation Skipped ...
Nam := TName.CreateAndFillPrepare(MemoryContext , 'Name=?', ['Turrican'])
if Nam.Fillone
begin
//We insert TName record to disk file database
DiskContext.AddOrUpdate(Nam);
end;
end;
DiskContext.AddOrUpdate(Nam); //Doesn't fail but doesn't insert or update the record.
The previous code tries to insert one record from a memory server to a physical database server. This isn't working...
Did you know what fails to make this approach of the previous pseudo-code?
Thanks!
Last edited by turrican (2016-05-25 14:20:38)
Offline