mORMot and Open Source friends
Check-in [583aff0f36]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:SynDBZeos: temporary solution to prevent DB connection creation inside TSQLDBZEOSConnectionProperties.CreateWithZURL
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 583aff0f36c366ffcb7eab1543f29ce8498b6590
User & Date: mpv 2018-06-06 07:57:17
Context
2018-06-06
08:21
{4599} tried to circumvent a random DeRef() function inlining compiler error (Delphi only) check-in: 58d63eddc1 user: ab tags: trunk
07:57
SynDBZeos: temporary solution to prevent DB connection creation inside TSQLDBZEOSConnectionProperties.CreateWithZURL check-in: 583aff0f36 user: mpv tags: trunk
2018-06-05
20:55
{4598} fixed dvoAllowDoubleValue process of some numbers check-in: ee60f02c55 user: ab tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynDBZeos.pas.

578
579
580
581
582
583
584







585
586
587
588
589
590
591
592
593

594
595
596
597
598
599
600
  if fDBMS in [dPostgreSQL,dFireBird] then begin
    {$ifdef ZEOS72UP} // new since 7.2up
    // Always load the lobs? Or just on accessing them?
    // if you allways copy the data by fetching the row than it doesn't make sense.
    fStatementParams.Add('cachedlob=false'); //default = False
    {$endif}
  end;







  {$ifdef ZEOS72UP} // new since 7.2up
  with (MainConnection as TSQLDBZEOSConnection).Database do
  // ZDBC: MultipleValuesInsertFirebird is buggy, MultipleValuesInsert slower
  if UseMetadata and not (fDBMS = dFirebird) then
    if GetMetadata.GetDatabaseInfo.SupportsArrayBindings then begin
      fBatchSendingAbilities := [cCreate, cUpdate, cDelete];
      OnBatchInsert := nil;
      fSupportsArrayBindings := true;
    end;

  {$endif}
end;

destructor TSQLDBZEOSConnectionProperties.Destroy;
begin
  FreeAndNil(fURL);
  FreeAndNil(fStatementParams);






>
>
>
>
>
>
>









>







578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
  if fDBMS in [dPostgreSQL,dFireBird] then begin
    {$ifdef ZEOS72UP} // new since 7.2up
    // Always load the lobs? Or just on accessing them?
    // if you allways copy the data by fetching the row than it doesn't make sense.
    fStatementParams.Add('cachedlob=false'); //default = False
    {$endif}
  end;
  // ZEOS_PREVENT_CONN will prevent unexpected connection creation inside ConnectionProperties.Create
  // TODO - rethink code below to prevent create connection inside this fucntion
  // Reasons: on the moment Properties are created (usually during server startup)
  // 1) actual database may not exists (multitenancy server what create DB's in runtime)
  // 2) in case of several connection props inside one process some of them may be used
  // occasiously or not used at all, so creating connection during server startup of overhead
  {$ifndef ZEOS_PREVENT_CONN}
  {$ifdef ZEOS72UP} // new since 7.2up
  with (MainConnection as TSQLDBZEOSConnection).Database do
  // ZDBC: MultipleValuesInsertFirebird is buggy, MultipleValuesInsert slower
  if UseMetadata and not (fDBMS = dFirebird) then
    if GetMetadata.GetDatabaseInfo.SupportsArrayBindings then begin
      fBatchSendingAbilities := [cCreate, cUpdate, cDelete];
      OnBatchInsert := nil;
      fSupportsArrayBindings := true;
    end;
  {$endif}
  {$endif}
end;

destructor TSQLDBZEOSConnectionProperties.Destroy;
begin
  FreeAndNil(fURL);
  FreeAndNil(fStatementParams);