You are not logged in.
Pages: 1
In 1.18 I use TSQLRestServerDB-based class and model with optional different "external" TSQLDBConnectionProperties (particularly TSQLDBSQLite3ConnectionProperties, TSQLDBZEOSConnectionProperties, TSQLDBFireDACConnectionProperties). There (for some DBMS) I can access TRestStorageExternal(StaticVirtualTable[]).OnEngineAddComputeID and override EngineAdd, EngineUpdate, EngineBatchSend and so on. But I can't do the same with TRestServerDB in 2.0
I'm a bit confused, probably I got it totally wrong. Will appreciate any clarification.
Last edited by Vitaly (2021-01-23 16:19:54)
Offline
Ok, probably this decision is ugly, but at least it works for my case.
Instead of (1.18)
TSQLRestStorageExternal(StaticVirtualTable[LModel.Tables[i]]).OnEngineAddComputeID :=
DoOnEngineAddComputeIDFirebird;
for 2.0 I used
TRestStorageExternal(TRestOrmServer(server).StaticVirtualTable[LModel.Tables[i]]).OnEngineAddComputeID :=
DoOnEngineAddComputeIDFirebird;
Overriding EngineAdd, EngineUpdate, EngineBatchSend for the whole TRestServerDB-based class, unfortunately, seems to be impossible, so far at least.
Offline
btw, if somebody is interested in my current results for external DBs:
TSQLDBSQLite3ConnectionProperties - fine
TSQLDBFireDACConnectionProperties (FB 2.5.9) - fine
TSQLDBZEOSConnectionProperties (FB 2.5.9, ZeosLib git master f347957defc8e89c381f5d06596ac3a170c5994e 2021-01-21):
with USE_SYNCOMMONS - nothing compiles since 1.18 units namings in Zeos;
without USE_SYNCOMMONS - compiles but throws errors during connection, like
Error SQLITE_ERROR (1) [Step] using 3.34.0 - TSqlDBZEOSConnectionProperties: unexpected TZSQLType "stUnknown", extended_errcode=1
Offline
@Vitaly
I didn't make any test with Zeos.
For sure, USE_SYNCOMMONS won't work since it is mORMot 1.18 specific.
Next week, I will try to debug it. Perhaps even mORmot 1.18 didn't work when USE_SYNCOMMONS was not defined.
Offline
Perhaps even mORmot 1.18 didn't work when USE_SYNCOMMONS was not defined.
I liked your supposition, so I rollbacked the actual "migration" project to 1.18 use and tested it with the same Zeos and without USE_SYNCOMMONS. It works fine, it is hard to say how fast/slow in comparing, but it works.
I can continue migration/testing with FireDAC without any problem, so Zeos support easily can wait if you'll have more important things (I might already distract you enough with my current 2.0 feedback).
Offline
Just a small non-critical issue, but very strange.
Creating a TRestServerDB instance with an empty model causes AV:
TRestServerDB.CreateWithOwnModel([]);
I hardly can imagine that someday I'll need an empty model, but I guess it'll be better to handle it without AV exception.
Anyway, I tried to debug and got a bit strange result. AV appears in
constructor TRestOrmServer.Create(aRest: TRest);
...
SetLength(fTrackChangesHistoryTableIndex, fTrackChangesHistoryTableIndexCount);
for t := 0 to fTrackChangesHistoryTableIndexCount - 1 do
fTrackChangesHistoryTableIndex[t] := -1; <---- hear
...
where (as I assume) it shouldn't get at all because of fTrackChangesHistoryTableIndexCount = 0. I guess I'm missing something simple...
Offline
@Vitaly,
got 8.0 running with mORMot 2. See https://sourceforge.net/p/zeoslib/code-0/7347/ also on Linux 64Bit.
Note the "USE_SYNCOMMONS" define is left for 1.18. To be able to distinguish between the unit names i use a new define "MORMOT2" yet. We can change the name if somebody has objections..?
Regards, Michael
Last edited by EgonHugeist (2021-02-27 18:03:01)
Offline
Not a problem. OpenSource rocks!
Leave some work 4u: Mormot v2 should not use the USE_SYNCOMMONS define any more. Replace it with MORMOT2. If you or others think the define is "dangerous" to use give me a hint for a better name and i'll replace it ASAP.
Michael
Offline
MORMOT2 seems fine to be, since it is internal to Zeos.inc / ZDBC.
It should not hurt.
Offline
Checked a couple of projects with mORMot2 and Zeos/FB. Seems, all ORM and Batch operations are going well. Thanks!
Delphi 10.4.2, Win64, freshest mORMot2, Zeos r7349, FB 2.5.9
PUREMORMOT2;MORMOT2
Offline
Pages: 1