#201 mORMot 1 » mORMot2 Wrapper generation broken » 2021-04-08 14:31:25

itSDS
Replies: 12

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.

#202 Re: mORMot 1 » New Statics for mORMot » 2021-03-29 19:42:53

@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 ?

#203 mORMot 1 » SynDBUniDAC - Patch from matkov does not work with my environment » 2021-03-29 19:25:47

itSDS
Replies: 3

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

#205 Re: mORMot 1 » The mORMot on Android » 2020-05-13 10:52:50

Interesting work.

i would like to test it on RS 10.4 do you think it will work ?

#206 mORMot 1 » Question: Using 1 Database for multiple mORMot Clients » 2020-05-13 10:50:55

itSDS
Replies: 3

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 ?

#207 Re: mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-20 20:08:42

I made it a little "Smarter" smile

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;

#208 Re: mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-20 19:45:53

I just made a copy and fixed the BLOB Part - But its possible to only change the BLOB Part for sure.

#209 Re: mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-20 15:21:21

sry ab didn't think about the size

#210 Re: mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-20 12:56:31

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.

#211 mORMot 1 » BUG NewStatementPrepared - AddObject » 2020-03-19 21:49:04

itSDS
Replies: 1

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

#212 Re: mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-19 21:19:33

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.

#213 Re: mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-18 07:51:39

Actually i use synoledb for test i ll post my results

#214 mORMot 1 » Problem with BLOB/UniDAC/REST/MSSQL » 2020-03-17 19:47:23

itSDS
Replies: 11

I have a Problem with Updating a TSQLRecord's Blob Data. The Problem is visible in this Picture (Screen from LOG Viewer)

LOG Snippet

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

#215 Re: mORMot 1 » Revision 2.x of the framework » 2020-03-16 09:39:27

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 ?)

#216 Re: mORMot 1 » SynDBUniDAC with prDirect compared to prNativeClient(prAuto) » 2019-11-30 09:26:17

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.

#217 mORMot 1 » SynDBUniDAC with prDirect compared to prNativeClient(prAuto) » 2019-11-29 09:40:19

itSDS
Replies: 2

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 ?

#218 Re: mORMot 1 » TID Guid » 2019-10-07 08:47:59

I think it will not work cause the TID as int64 is essential for mORMot and massivly used internally

#219 mORMot 1 » Problem to create Query Params for MS-SQL RetrieveDocVariantArray » 2019-08-01 21:10:18

itSDS
Replies: 1

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 ?

#220 Re: mORMot 1 » Error Linking new 3.29 sqlite.obj to my Project » 2019-07-29 20:46:24

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

#221 Re: mORMot 1 » Error Linking new 3.29 sqlite.obj to my Project » 2019-07-28 15:05:19

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
          }

#222 Re: mORMot 1 » Error Linking new 3.29 sqlite.obj to my Project » 2019-07-27 11:11:00

Oh nothing wrong with, but i build them by myself because i also build the 64Bit Versions

#223 Re: mORMot 1 » Error Linking new 3.29 sqlite.obj to my Project » 2019-07-26 22:38:42

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 ?

#224 mORMot 1 » Error Linking new 3.29 sqlite.obj to my Project » 2019-07-26 14:49:31

itSDS
Replies: 7

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)

#225 mORMot 1 » Question - HowTo Connect to MS-SQL (SQL Server) » 2019-04-17 18:30:04

itSDS
Replies: 1

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

#226 Re: mORMot 1 » Little Patch for SynOleDB » 2019-04-15 11:11:04

@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 ?

#227 mORMot 1 » Little Patch for SynOleDB » 2019-04-13 07:59:26

itSDS
Replies: 2

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;

#228 mORMot 1 » TestSQL3 - Exception in _AES256 Test (win32) » 2019-03-31 10:22:48

itSDS
Replies: 1

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 !

#230 mORMot 1 » SynLog without BLOB - Parameter Values » 2019-03-12 11:46:06

itSDS
Replies: 2

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

#232 Re: mORMot 1 » ExecuteInlined Different Param Handling MySQL - MSSQL » 2019-02-26 13:14:30

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

#233 Re: mORMot 1 » ExecuteInlined Different Param Handling MySQL - MSSQL » 2019-02-26 07:19:43

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

#234 mORMot 1 » ExecuteInlined Different Param Handling MySQL - MSSQL » 2019-02-25 14:52:52

itSDS
Replies: 6

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 ?

#235 Re: mORMot 1 » Database Error » 2018-11-19 11:51:24

ty egonhugeist

next time i'll create login for zeos bug tracker an post it there smile

#236 Re: mORMot 1 » Database Error » 2018-11-15 09:46:46

We tested the 7.2-patches branch and the error has gone.

#237 Re: mORMot 1 » Database Error » 2018-11-14 10:04:59

Thank you we already changed the zeos version but not the branch - I'll try it with the one you said.

#238 Re: mORMot 1 » Database Error » 2018-11-13 18:18:33

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 ?

#239 mORMot 1 » Database Error » 2018-11-13 17:05:43

itSDS
Replies: 7

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 ?

#240 mORMot 1 » New Amalgamation Patch is 3.25.1 » 2018-09-25 09:20:08

itSDS
Replies: 1

There is a new SQLite Version pls change expected Version in Git

#241 mORMot 1 » sqlite.c compile error with tokyo 10.2.3 » 2018-03-20 09:10:12

itSDS
Replies: 1

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

#242 mORMot 1 » Starting new Projekt with DDD » 2018-02-26 14:17:11

itSDS
Replies: 1

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 ?

#243 mORMot 1 » Little nil Pointer BUG in SynCommons » 2018-02-21 12:30:51

itSDS
Replies: 1

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

#244 mORMot 1 » TRecordVersion is exportet to SynCrossPlatform » 2017-10-11 09:54:11

itSDS
Replies: 1

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 ?

#245 Re: mORMot 1 » Adding TRecordVersion to existing Table(s) » 2017-10-09 21:02:47

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 ?

#246 mORMot 1 » Adding TRecordVersion to existing Table(s) » 2017-10-09 14:17:07

itSDS
Replies: 1

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

#247 mORMot 1 » Documentation error TSQLRecordTableDelete » 2017-10-08 14:53:42

itSDS
Replies: 0

Hi AB in your Documentation is a "d" missing at the end of TSQLRecordTableDelete the Tables name is TSQLRecordTableDeleted

#248 Re: mORMot 1 » Exception and Fix » 2017-09-21 11:26:40

Can you pls integrate this in Repositorie ?

#249 mORMot 1 » Exception and Fix » 2017-09-12 17:25:42

itSDS
Replies: 3

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

#250 Re: mORMot 1 » MySQL Server has gone away » 2017-08-01 13:52:55

Ok found a solution in setting ConnectionTimeOutMinutes to a value

Board footer

Powered by FluxBB