You are not logged in.
Hi Arnaud, i generated a soa interface for a new service and created the CrossPlatform Wrappers for an app.
But the generated pas - Sourcecode ist broken. I send you an example via EMail.
@ab i also have a question,
i compile my sqlite.obj sqlite.o with bcc32/64 from Rad Studio 10.4.2 and they work, is there a reason not to do this ?
Hi AB today i update mORMot to the actual Version and testet it
We use SynDBUniDAC.
But some of the changes from matkov throw unexpected SQL Errors with MySQL and MSSQL
I had to revert SynDBUniDac to the "old" Version.
MySQL Error:
Erste Gelegenheit für Exception bei $76A4A8B2. Exception-Klasse EMySqlException mit Meldung '#HY000Unerlaubte Mischung von Sortierreihenfolgen (latin1_german2_ci, IMPLICIT) und (utf8_general_ci, COERCIBLE) für Operation '=''. Prozess imsys.exe (7000)
with Query:
delete from tabellenbeziehungen where (beziehungsart = :("MZ_MDELizenzen"):) and (referenztabelle = :("monteure"):) and (referenzfeld = :("monteurid"):) and (bezug = :("DFCloud.Lizenzen"):) and (bezugsfeld = :("Lizenzcode"):) and (referenzwert = :(53):)MS-SQL Error:
Erste Gelegenheit für Exception bei $76A4A8B2. Exception-Klasse EUniError mit Meldung 'Operandentypkollision: nvarchar(max) ist inkompatibel mit sql_variant'. Prozess imsys.exe (7000)
with Query:
SELECT stammdatenid f0, parentID f1, kategorie f2, auswahl f3, anzeigen f4, feld01 f5, hostwert f6, unplausibel_meldungstext f7, extrem_unplausibel_meldungstext f8 FROM stammdaten where (kategorie = :("Vorgangsgrund"):) order by stammdatenid
(and other select queries)Removing the Prepare in line 768:
function TSQLDBUniDACStatement.DatasetPrepare(const aSQL: string): boolean;
begin
(fQuery as TUniQuery).SQL.Text := aSQL;
// TUniQuery(fQuery).Prepare;
fQueryParams := TUniQuery(fQuery).Params;
result := fQueryParams<>nil;
end;solves the Problem also, but as i don't know what matkov used to do with the patch, i reverted complete to the former SynDBUniDAC.pas - i think i don't need the patch
ty i'll try your ideas
Interesting work.
i would like to test it on RS 10.4 do you think it will work ?
Using an SQL Server for Example MySQL with mORMot TSQLRecords i have the Problem at a Customer:
We need 1 mORMot in DMZ and 1 internal but using the same SQL Server.
Both Client insert in the same TSQLRecord.
now wi get duplicate key errors.
Is it possible (by option) that both Client get the latest free key before inserting ?
I made it a little "Smarter" ![]()
procedure TSQLDBUniDACStatement.DataSetBindSQLParam(const aArrayIndex, aParamIndex: integer; const aParam: TSQLDBParam);
var
P : TDAParam;
begin
// SynDBLog.Enter('DataSetBindSQLParam(%, %, %)', [aArrayIndex, AParamIndex, Length(aParam.VData)], Self);
if fQueryParams[aParamIndex] is TDAParam then begin
with aParam do begin
P := TDAParam(fQueryParams[aParamIndex]);
P.ParamType := SQLParamTypeToDBParamType(VInOut);
if VinOut <> paramInOut then
case VType of
SynTable.ftBlob: begin
{$ifdef UNICODE}
if aArrayIndex>=0 then
P.SetBlobData(Pointer(VArray[aArrayIndex]),Length(VArray[aArrayIndex]))
else
P.SetBlobData(Pointer(VData),Length(VData));
{$else}
if aArrayIndex>=0 then
P.AsString := VArray[aArrayIndex]
else
P.AsString := VData;
{$endif}
exit;
end;
end;
end;
end;
inherited DataSetBindSQLParam(aArrayIndex, aParamIndex, aParam);
end;I just made a copy and fixed the BLOB Part - But its possible to only change the BLOB Part for sure.
sry ab didn't think about the size
Hi AB,
today i found the real Solution for the BUG.
My Previuosly change is not correct and can be removed.
UniDAC has overriden the TParam with TDAParam in DBAccess.
Your TSQLDBDatasetStatement.DataSetBindSQLParam uses TParam.SetBlobData function and does not check that TDAParam has another Implementation for SetBlobData (Its not overrride / virtual)
As Solution i added TSQLDBUniDACStatement.DataSetBindSQLParam which checks wether TParam is a TDAParam and then calls the correct SetBlobData function.
Pls change my BUG FIX as follows:
SynDBUniDAC.pas
class declaration:
/// implements a statement via a UniDAC connection
TSQLDBUniDACStatement = class(TSQLDBDatasetStatement)
protected
/// initialize and set fQuery: TUniQuery internal field as expected
procedure DatasetCreate; override;
/// set fQueryParams internal field as expected
function DatasetPrepare(const aSQL: string): boolean; override;
/// execute underlying TUniQuery.ExecSQL
procedure DatasetExecSQL; override;
procedure DataSetBindSQLParam(const aArrayIndex, aParamIndex: integer; const aParam: TSQLDBParam); override;
public
end;procedure TSQLDBUniDACStatement.DataSetBindSQLParam(const aArrayIndex, aParamIndex: integer; const aParam: TSQLDBParam);
var P: TDAParam;
I64: Int64;
tmp: RawUTF8;
begin
// SynDBLog.Enter('DataSetBindSQLParam(%, %, %)', [aArrayIndex, AParamIndex, Length(aParam.VData)], Self);
if fQueryParams[aParamIndex] is TDAParam then begin
with aParam do begin
P := TDAParam(fQueryParams[aParamIndex]);
P.ParamType := SQLParamTypeToDBParamType(VInOut);
if VinOut <> paramInOut then
case VType of
SynTable.ftNull: begin
P.Clear;
{$ifdef UNICODE}
P.AsBlob := nil; // avoid type errors when a blob field is adressed
{$else}
P.AsString := '';
{$endif}
end;
SynTable.ftInt64: begin
if aArrayIndex>=0 then
I64 := GetInt64(pointer(VArray[aArrayIndex])) else
I64 := VInt64;
{$ifdef UNICODE}
P.AsLargeInt := I64;
{$else}
if (PInt64Rec(@I64)^.Hi=0) or (PInt64Rec(@I64)^.Hi=Cardinal(-1)) then
P.AsInteger := I64 else
if TSQLDBDatasetConnectionProperties(Connection.Properties).
fForceInt64AsFloat then
P.AsFloat := I64 else
P.Value := I64;
{$endif}
end;
SynTable.ftDouble:
if aArrayIndex>=0 then
P.AsFloat := GetExtended(pointer(VArray[aArrayIndex])) else
P.AsFloat := unaligned(PDouble(@VInt64)^);
SynTable.ftCurrency:
if aArrayIndex>=0 then
P.AsCurrency := StrToCurrency(pointer(VArray[aArrayIndex])) else
P.AsCurrency := PCurrency(@VInt64)^;
SynTable.ftDate:
if aArrayIndex>=0 then begin
UnQuoteSQLStringVar(pointer(VArray[aArrayIndex]),tmp);
P.AsDateTime := Iso8601ToDateTime(tmp);
end else
P.AsDateTime := PDateTime(@VInt64)^;
SynTable.ftUTF8:
if aArrayIndex>=0 then
if (VArray[aArrayIndex]='') and
fConnection.Properties.StoreVoidStringAsNull then
P.Clear else begin
UnQuoteSQLStringVar(pointer(VArray[aArrayIndex]),tmp);
if fForceUseWideString then
P.Value := UTF8ToWideString(tmp) else
P.AsString := UTF8ToString(tmp);
end else
if (VData='') and fConnection.Properties.StoreVoidStringAsNull then
P.Clear else
if fForceUseWideString then
P.Value := UTF8ToWideString(VData) else
P.AsString := UTF8ToString(VData);
SynTable.ftBlob:
{$ifdef UNICODE}
if aArrayIndex>=0 then
P.SetBlobData(Pointer(VArray[aArrayIndex]),Length(VArray[aArrayIndex]))
else
P.SetBlobData(Pointer(VData),Length(VData));
{$else}
if aArrayIndex>=0 then
P.AsString := VArray[aArrayIndex] else
P.AsString := VData;
{$endif}
else
raise ESQLDBDataset.CreateFmt(
'%.DataSetBindSQLParam: Invalid type % on bound parameter #%d',
[self,ord(VType),aParamIndex+1]);
end;
end;
end else
inherited DataSetBindSQLParam(aArrayIndex, aParamIndex, aParam);
end;I made some more modifications to SynDBUniDac. i will send it to you by mail.
Hi AB i found a litte BUG in NewStatementPrepared:
see the line with // itSDS
function TSQLDBConnection.NewStatementPrepared(const aSQL: RawUTF8;
ExpectResults, RaiseExceptionOnError, AllowReconnect: Boolean): ISQLDBStatement;
var Stmt: TSQLDBStatement;
ToCache: boolean;
ndx,altern: integer;
cachedSQL: RawUTF8;
procedure TryPrepare(doraise: boolean);
var Stmt: TSQLDBStatement;
begin
Stmt := nil;
try
InternalProcess(speActive);
try
Stmt := NewStatement;
Stmt.Prepare(aSQL,ExpectResults);
if ToCache then begin
if fCache=nil then
fCache := TRawUTF8List.Create([fObjectsOwned,fNoDuplicate,fCaseSensitive]);
if fCache.AddObject(aSQL,Stmt)>=0 then // itSDS
Stmt._AddRef else // will be owned by fCache.Objects[]
SynDBLog.Add.Log(sllWarning,'NewStatementPrepared: unexpected '+
'cache duplicate for %',[Stmt.SQLWithInlinedParams],self);
end;
result := Stmt;
finally
InternalProcess(speNonActive);
end;
except
on E: Exception do begin
with SynDBLog.Add do
if [sllSQL,sllDB,sllException,sllError]*Family.Level<>[] then
LogLines(sllSQL,pointer(Stmt.SQLWithInlinedParams),self,'--');
Stmt.Free;
result := nil;
StringToUTF8(E.Message,fErrorMessage);
fErrorException := PPointer(E)^;
if doraise then
raise;
end;
end;
end;the former used cachedSQL - Value is sometimes empty
Results: After a while of Debugging in found that the Problem is in UNIDAC. I get the same error with MySQL / MSSQL - Provider.
I reproduced the behavior every time. The Problem with mORMot i have only with the SynCrossPlatform Client. Here SynDBUniDAC is used. As a Workaround i modified TSQLDBUniDACConnectionProperties.
My Code is not perfect normally i should set
UseCache := false
in Create.
function TSQLDBUniDACConnectionProperties.IsCachable(P: PUTF8Char): boolean;
// UNIDAC Probleme mit Update - Statements mit BLOB Parametern.
// Bei gecachten Statement wird der BLOB immer aus dem "Cache" genommen
begin
result := not IdemPChar(P,'UPDATE ');
if result then
result := inherited IsCachable(P);
end;There is some Strange Behavior in UniDAC, where i could not find the error. SetBlobParam set's the Blob correctly, but TCustomDASQL.AssignParamValue( seems to use a wrong Value from "i don't know where" it is taken.
Actually i use synoledb for test i ll post my results
I have a Problem with Updating a TSQLRecord's Blob Data. The Problem is visible in this Picture (Screen from LOG Viewer)
I update 3 "BinaerdatenRecord" after i insert them. I update 2 fields, BLOB Field Binaerdaten and Integer Field GroesseinBytes
In the First Call mORMot / UniDAC calls Prepare for the Update Statement.
In the following calls the Prepared Statement is used.
As you can see in the violet boxes the BLOB - Data has different sizes 143.5 / 119.2 and 100.4KB
the Blob Parameter is 110210 Byte
The Error is:
All 3 Database Records are filled with the Same BLOB - Data
Now my Question:
Is it a mORMot or a UniDAC Problem ? As Database Server i Use MS-SQL 2012
Is it Possible to disable Prepared Statement for Queries with BLOB Parameter
I like your upgrade thoughts and filled out the survey
What i was missing is : will complete CrossPlatform support available with 10.4 ? (They change something with arc ?)
Hi mpv i used the syndboledb before, but offen i get Exception that free was called from wrong thread in disconnect.
and we have customer in great business where the installation of sqlncli is not possible.
Wih new UniDAC 8.1.2 i wanted to give Unidac a try with SQL Server.Provider=prDirect where no extra Software ist needed.
Yesterday i found the solution for the UniDAC Connect "lag":
Just set SQL Server.ConnectionTimeout to 0 in Specialoptions.
Hi i use UniDAC 8.1.2 for SQL Server 11 with mORMot's SynDBUniDAC.
Here i made some Speedtests and compared the divers SQL Server.Provider Options.
The Queries itself are nearly with the same Speed. But in the first Connect Part of any ServerRequest the prDirect Option uses 120ms on my System to Connect. the prAuto only 10ms that is 12times slower.
We use mORMot as Rest/Soa Service, for every Rest Request the Connection is newly opened.
Some Heavily transfers use 2seconds with prAuto and 10s with prDirect.
The Reason ist the 120ms Connection Time.
Does anybody have a idea why direct connect is that slower ?
I think it will not work cause the TID as int64 is essential for mORMot and massivly used internally
Hi Arnaud,
i try to select some SQLRecord from External MS-SQL Database.
we wan't to select all record where the field (Messzeitpunkt : TDateTime) = date
i tried a lot of valid ms-sql statements, but every time the mORMot Parser makes errors:
Version1:
whereStatement = convert(date, GETDATE()) = convert(date, Messzeitpunkt)
20190801 22095955 2 warn mORMotDB.TSQLRestStorageExternal(02c45990) TSQLRestStorageExternal.AdaptSQLForEngineList: statement too complex -> would use SQLite3 virtual engine [SELECT ID,CreationDate,LastEditDate,AuftragStartEventID,Gruppierung,Ursprung,IPAdresse,Port,Messzeitpunkt,Barcode,Drehmoment,DrehmomentErgebnis,Drehwinkel,DrehwinkelErgebnis,GesamtErgebnis,Daten,SpindelTag,ControllerName,TighteningID,TorqueUnits,BatchCount,BatchSize,BatchStatus,CountOfScrewSteps,Screwprogram,Torquehighlimit,Torquelowlimit,Anglehighlimit,Anglelowlimit,ResultUniqueID,EORTimeStamp FROM EOR_QSYSOpenProtocolRecord WHERE convert(date, GETDATE()) = convert(date, Messzeitpunkt)]
Verstion 2:
whereStatement = CONVERT(nvarchar(max), messzeitpunkt, 23)=?, ['2019-08-01']
Error:
mORMotDB.TSQLRestStorageExternal(02ab5990) TSQLRestStorageExternal.AdaptSQLForEngineList: unsupported function CONVERT() for [SELECT ID,CreationDate,LastEditDate,AuftragStartEventID,Gruppierung,Ursprung,IPAdresse,Port,Messzeitpunkt,Barcode,Drehmoment,DrehmomentErgebnis,Drehwinkel,DrehwinkelErgebnis,GesamtErgebnis,Daten,SpindelTag,ControllerName,TighteningID,TorqueUnits,BatchCount,BatchSize,BatchStatus,CountOfScrewSteps,Screwprogram,Torquehighlimit,Torquelowlimit,Anglehighlimit,Anglelowlimit,ResultUniqueID,EORTimeStamp FROM EOR_QSYSOpenProtocolRecord WHERE CONVERT(nvarchar(max), messzeitpunkt, 23)=:('2019-08-01'):]
do you have an idea how to get the desired records ?
Is it a bug or do i use it wrong ?
yes i'm in contact with bruneau from embarcadero who found the reason in sqlite.c. SQLite 3.29 includes math.h but 3.28 does not.
if you have access to the embarcadero discourse page you can read about it
Hi AB, just to close this issue.
the external symbol __ieee_32_p_inf is defined in math.h if INFINITY is not defined
in 3.28 there seems to be INFINTY defined (i can not find out where ..)
in 3.29 it is not defined resulting in using the definition from math.h
in Line 30821 of 3.29 sqlite.c it is used. In 3.28 the constant and in 3.29 the external definition.
As work around in changed the code to use the constant in 3.29 as in 3.28 - Now i can link it again.
}else{
// #ifdef INFINITY // auskommentiert by itSDS
// result = INFINITY*s; // auskommentiert by itSDS
//#else // auskommentiert by itSDS
result = 1e308*1e308*s; /* Infinity */
//#endif // auskommentiert by itSDS
}Oh nothing wrong with, but i build them by myself because i also build the 64Bit Versions
But i do not get this error using compiled SQLite 3.28 obj. It came with 3.29.
Normally i would say that the linker is missing a lib file with the named function...
Embarcadero made a lot changes to bcc in 10.3.2 and it may be a solution to use an older Version but why - if its only a missing function ?
Hi AB
i get this error:
[dcc32 Fehler] SynSQlite3Static.pas(1294): E2065 Ungenügende Forward- oder External-Deklaration: '__ieee_32_p_inf'
linking latest (self build) sqlite3.obj
Here is my build command
"c:\Program Files (x86)\Embarcadero\Studio\20.0\bin\bcc32.exe" -6 -Oi -O2 -c -d -u- -I"c:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\shared" sqlite3.c
do you have any idea whats missing ? (With your sqlite3.obj i can link successfully)
Some of my installations use Microsoft SQL Server as Backend. But cause of some mysterious Exception with TOleDBMSSQL2012ConnectionProperties i tried the Other Implementations for MS-SQL
First i have to say i get only 2 to work first the TOleDBMSSQL2012ConnectionProperties an second the TSQLDBUniDACConnectionProperties
In the UniDAC i don't get the Exception i get with the other (see here: https://synopse.info/forum/viewtopic.php?id=4971)
as described i tried to use The ZEOS Implementation but don'get it to work. The main reason is: i can't find working examples.
I wan't to replace
TOleDBMSSQL2012ConnectionProperties.Create(ADBSettings.Host, ADBSettings.Database, ADBSettings.Username, ADBSettings.Password);
with something like:
TSQLDBZEOSConnectionProperties.Create(TSQLDBZEOSConnectionProperties.URI(dMSSQL, ADBSettings.Host + ':' + ADBSettings.Port), ADBSettings.Database, ADBSettings.Username, ADBSettings.Password);
But it raises an Exception ntwdblib.dll not found. In the Documentation a 4 Interfaces which i can use OleDB, ADO, ODBC i tried different String instead of dMSSQL OleDB[mssql], ADO[mssql] but the error is driver not found.
can anybody pls make some working examples for the ZEOS uri to connect as stated above ?
What are the prerequisites
And last but not least what will be the best (fastest) way to connect to MS-SQL
Thank you in advance
@Mpv ty for your answer, but my patch does not solve the underlying problem i found out yesterday
Im Doing a nested Query with TOleDBMSSQL2012ConnectionProperties Calling ExecuteInlined.
The Schema is
var
LRows1, LRows2 : ISQLDBRows;
begin
...
LRows1 := ConnectionProperties.ExecuteInlned(SomeSQL, true);
While LRows1.Step do begin
.. Do Something with LRows1
LRows2 := ConnectionProperties.ExecuteInlined(AnotherSQL, true);
if LRows2.Step then
.. Do Something with LRows2
end;
if ConnectionProperties is TOleDBMSSQL2012ConnectionProperties then i got Exception in the Second ExecuteInlined
if ConnectionProperties is TSQLDBZEOSConnectionProperties then it works (MySQL - Server)
Seems to be something wrong with the TOleDBMSSQL2012ConnectionProperties Implementation reusing the internal Connection.
Any Idea ?
Hi AB i got an Exception in SynOLEDB - TOleDBStatement.ExecutePrepared
mr was nil after Query
Here is my Patch (Line 1997 ff)
if not OleDBConnection.OleDBProperties.fSupportsOnlyIRowset then begin
// use IMultipleResults for 'insert into table1 values (...); select ... from table2 where ...'
res := fCommand.Execute(nil,IID_IMultipleResults,fDBParams,@fUpdateCount,@mr);
if assigned(mr) and (res=E_NOINTERFACE) then // <-- PATCH itSDS
OleDBConnection.OleDBProperties.fSupportsOnlyIRowset := true else begin
repeat
res := mr.GetResult(nil,0,IID_IRowset,@fUpdateCount,@RowSet);
until Assigned(RowSet) or (res <> S_OK);
end;
end;Today i testet the TestSQL3 with Rio 10.3.1 and got Exception (access violation at 0x00000000: read of adress 0x00000000 ....) in _AES256 Test.
The 64Bit Version works !
ty it works ![]()
Hi, i store ~ 100GB in SQLite DB and have SYNLOG with LOG_VERBOSE active.
My LOGS are growing rapidly because the BLOB Data is stored in the Log as Parameter to mOTMotSQLite3.TSQLRestServer INSERT/UPDATE Log Entries.
Is there a Option to disable the Loging of BLOB Contents. I would like to have the other SQL - Log Entry only the BLOB Parameter should not be saved (for example Replaced by BLOB(Size:616000)) Size is optional ..
BR
Stefan
ok i allready did so ![]()
I understand whats causing my query problem - TY
What i don't understand is why is not "allowed" to store '' in Textfields in MSSQL - we do this for over 20 years now. - What do you mean with allowed ?
In my understanding
if text = null then the Values is "not set" or Empty
if text = '' then the Field ist Empty String
Sometimes it is neccessary to make a difference between '' and null
Thank you - Just to add it here i was using TSQLDBZEOSConnectionProperties for MySQL and OleDBMSSQL2012ConnectionProperties for MSSQL I try now the ZEOS implementation fpr MS-SQL
Hi AB,
i found a problem with the Param generation in Executeinlined
we give the following query to Executelined
select anyvalue from thetable where textvalue is null or textvalue = :(""):
in MySQL the generated Query is correct:
select anyvalue from thetable where textvalue is null or textvalue = ''
in MSSQL the Query is wrong generated
select anyvalue from thetable where textvalue is null or textvalue = null
why is the Empty "" String in MSSQL converted to null ?
Where do i have to correct the Problem ?
ty egonhugeist
next time i'll create login for zeos bug tracker an post it there ![]()
We tested the 7.2-patches branch and the error has gone.
Thank you we already changed the zeos version but not the branch - I'll try it with the one you said.
I think so too, but the Query is generated by mORMot on Server after Update Request from REST Client.
And as Hint the Query works after the Transfer is restarted on the client.
The field binaerdaten is a mediumblob on MySQL Server
Can there be Problem with the ZEOS Lib ?
Hi ab,
everything runs fine, but since Yesterday we get a database error i can not identify / don't know what to do with
The Errormessage is this:
SynDBZeos.TSQLDBZEOSStatement(061AE280) update BinaerdatenRecord set CreationDate=0,LastEditDate=135469259944,GUID='{90944806-B92D-C7C9-1CFE-99CF08C3C3AA}',Binaerdaten=*BLOB*,Datenformat='image/jpeg',GroesseInByte=90112 where ID=80358
EZSQLException ("SQL Error: Can't send long data for non-string/non-binary data types (parameter: 3)")
SynDBZeos.TSQLDBZEOSStatement(062D0AB0) update BinaerdatenRecord set LastEditDate=135469259945,Binaerdaten=*BLOB*,GroesseInByte=122880 where ID=80359
EZSQLException ("SQL Error: Can't send long data for non-string/non-binary data types (parameter: 1)")Our Environment ist libZEOS - 7.3 V5275
mORMot latest Version
Our Database is a MySQL 5.7.19
We have a simple TSQLRecord with 1 TSQLRawBlob called "Binaerdaten"
Does you or anybody have a clue for us ?
There is a new SQLite Version pls change expected Version in Git
Hi AB there is the following compiler error generated from bcc of Tokyo (and other i suppose)
./amalgamation/sqlite3.c:50463:21: error: Wert in Ausdruck erwartet
#if SQLITE_HAS_CODEC <----
in sqlite.c you define SQLITE_HAS_CODEC
with
#define SQLITE_HAS_CODEC
to make the code compile you have to provide a value to SQLITE_HAS_CODEC
correct code:
#define SQLITE_HAS_CODEC 0
or
#define SQLITE_HAS_CODEC 1
I non't know if it should be a 1 or 0
can you pls fix this
Hi Arnaud, im thinking about reprogramming one of out MVC Services with DDD Backend from scratch (with a little copy&paste).
I saw in mormot's ddd folder some interesting classes. And the servbook ddd sample. But i see not really a red line to use it.
Is there a more complete sample e.g. servweb (as in your slideshow) to see how it can work ?
Hi Arnaud, we got a 0xc000005 in ExistsIniName, cause P was nil (Empty String assigned to PChar)
SynCommons - Line 29306ff
function ExistsIniName(P: PUTF8Char; UpperName: PAnsiChar): boolean;
var table: PNormTable;
begin
result := false;
table := @NormToUpperAnsi7;
if (P <> nil) and (P^<>'[') then // <<-- Add this pls
repeat
if P^=' ' then begin
repeat inc(P) until P^<>' '; // trim left ' '
if P^=#0 then
break;can you pls add this to repository - Many Thx
Hi AB,
the Export to SynCrossPlatform includes the Version Property from TRecordVersion as it is included in the RTTI.
What do you think will be better: Remove it from export or specify type TRecordVersion = int64 in SynCrossPlatform.pas ?
My Problem has to do with this Ticket
https://synopse.info/fossil/info/74e76e975a401
I know now Version is a sequential number. What do you think about using Version as Timestamp with high Resolution ?
Hi AB,
i have an old ORM with > 10 Tables and want to add Replication.
My idea was : Add TRecordVersion to every TSQLRecord - worked - but Version = null
I tried to Replicate all Tables on other Server with code like this:
TAutoFree.One(FMasterClient, TSQLHttpClientWinHTTP.Create(AnsiString(FMasterHostname), AnsiString(FMasterRESTPort), Model, FMasterUseHTTPS));
FMasterClient.IgnoreSSLCertificateErrors := true;
FMasterClient.Compression := [hcSynShaAes];
if FMasterClient.SetUser(cUsername, cPassword) then begin
DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord1, FMasterClient);
DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord2, FMasterClient);
DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord3, FMasterClient);
DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord4, FMasterClient);
DFLizenz.Database.RecordVersionSynchronizeSlave(TSQLRecord5, FMasterClient);
end;But nothing happend - then i thought (without reading your code)
set Version on Master to 1
But only TSQLRecord1 will be updatet then.
I think the Problem is that Verion on master is wrong initialized. I Think i have to set Version to a "unique" sequential ID or for every Table ?
or better can you enhance it to
DFLizenz.Database.RecordVersionSynchronizeSlave([TSQLRecord1, TSQLRecord2, TSQLRecord3, TSQLRecord4, TSQLRecord5], FMasterClient);
BR
Stefan
Hi AB in your Documentation is a "d" missing at the end of TSQLRecordTableDelete the Tables name is TSQLRecordTableDeleted
Can you pls integrate this in Repositorie ?
Hi AB
using my MVC Server i entered for testing reason the URL of a TMVCAction in my Browser and got Exception 0x0000000
Please change this function
function TInterfaceFactory.FindMethodIndex(const aMethodName: RawUTF8): integer;
begin
if (self=nil) or (aMethodName='') then
result := -1 else
if fMethodsCount<10 then begin
for result := 0 to fMethodsCount-1 do
if IdemPropNameU(fMethods[result].URI,aMethodName) then
exit;
result := -1;
end else
result := fMethod.FindHashed(aMethodName);
if (result<0) and (Length(aMethodName) > 0) and (aMethodName[1]<>'_') then /// <<<<---- added Length Control. aMethodName was = '' in my case and [1] caused the Exception !
result := FindMethodIndex('_'+aMethodName);
end;Thanks
Ok found a solution in setting ConnectionTimeOutMinutes to a value