DMLRefresh Error with 9.01

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

DMLRefresh Error with 9.01

Post by FredS » Fri 17 Sep 2021 18:15

DB:

Code: Select all

CREATE DATABASE 'TEST.FDB'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
default character set UTF8 collation UNICODE_CI_AI ;
Table:

Code: Select all

CREATE TABLE SERVERS (
    ID                BIGINT GENERATED BY DEFAULT AS IDENTITY,
    DOMAINID          BIGINT NOT NULL,
    SERVER            VARCHAR(80) NOT NULL,
    ISDC              BOOLEAN DEFAULT FALSE NOT NULL,
    WASONLINE         BOOLEAN,
    OSTYPE            INTEGER,
    OSCOMMENT         VARCHAR(80),
    OSFLAGS           INTEGER,
    EXCLUDEFROMFETCH  BOOLEAN DEFAULT FALSE,
    INFETCHDATA       BOOLEAN DEFAULT FALSE
);
DFM:

Code: Select all

object Form2: TForm2
  Left = 0
  Top = 0
  Caption = 'Disconnected'
  ClientHeight = 442
  ClientWidth = 624
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -12
  Font.Name = 'Segoe UI'
  Font.Style = []
  PixelsPerInch = 96
  TextHeight = 15
  object DBGrid1: TDBGrid
    Left = 8
    Top = 88
    Width = 608
    Height = 346
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -12
    TitleFont.Name = 'Segoe UI'
    TitleFont.Style = []
  end
  object btAddServer: TButton
    Left = 360
    Top = 37
    Width = 75
    Height = 25
    Caption = 'btAddServer'
    TabOrder = 1
    OnClick = btAddServerClick
  end
  object cbServer: TComboBox
    Left = 360
    Top = 8
    Width = 169
    Height = 23
    Style = csSimple
    TabOrder = 2
    Items.Strings = (
      '[FE80::6F79:151:D2B3:1476]')
  end
  object btConnect: TButton
    Left = 535
    Top = 8
    Width = 75
    Height = 25
    Caption = 'btConnect'
    TabOrder = 3
    OnClick = btConnectClick
  end
  object Con: TUniConnection
    ProviderName = 'InterBase'
    Database = 'D:\My Projects\TEST.FDB'
    SpecificOptions.Strings = (
      'InterBase.Charset=UTF8'
      'InterBase.UseUnicode=True'
      'SQL Server.Authentication=auWindows'
      'InterBase.Role=RDB$ADMIN'
      'SQL Server.ForceCreateDatabase=False'
      'InterBase.ForceUnloadClientLibrary=True')
    Options.AllowImplicitConnect = False
    Options.KeepDesignConnected = False
    Options.DefaultSortType = stCaseInsensitive
    PoolingOptions.MinPoolSize = 4
    Username = 'SYSDBA'
    LoginPrompt = False
    Left = 168
    Top = 53
    EncryptedPassword = '92FF9EFF8CFF8BFF9AFF8DFF94FF9AFF86FF'
  end
  object InterBaseUniProvider1: TInterBaseUniProvider
    Left = 64
    Top = 8
  end
  object SQLServerUniProvider1: TSQLServerUniProvider
    Left = 264
    Top = 8
  end
  object tbServers: TUniTable
    TableName = 'Servers'
    Connection = Con
    KeyFields = 'ID'
    DMLRefresh = True
    RefreshOptions = [roBeforeEdit]
    AutoCalcFields = False
    IndexFieldNames = 'ISDC DESC;SERVER'
    AfterOpen = tbServersAfterOpen
    Left = 112
    Top = 128
    object tbServersID: TLargeintField
      AutoGenerateValue = arAutoInc
      FieldName = 'ID'
    end
    object tbServersDOMAINID: TLargeintField
      FieldName = 'DOMAINID'
      Required = True
    end
    object tbServersSERVER: TWideStringField
      FieldName = 'SERVER'
      Required = True
      Size = 80
    end
    object tbServersISDC: TBooleanField
      FieldName = 'ISDC'
      Required = True
    end
    object tbServersWASONLINE: TBooleanField
      FieldName = 'WASONLINE'
    end
    object tbServersOSTYPE: TIntegerField
      FieldName = 'OSTYPE'
    end
    object tbServersOSCOMMENT: TWideStringField
      FieldName = 'OSCOMMENT'
      Size = 80
    end
    object tbServersOSFLAGS: TIntegerField
      FieldName = 'OSFLAGS'
    end
    object tbServersEXCLUDEFROMFETCH: TBooleanField
      FieldName = 'EXCLUDEFROMFETCH'
    end
    object tbServersINFETCHDATA: TBooleanField
      FieldName = 'INFETCHDATA'
    end
  end
  object DataSource1: TDataSource
    DataSet = tbServers
    Left = 224
    Top = 128
  end
end
Source:

Code: Select all

unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, DBAccess, Uni, UniProvider, InterBaseUniProvider, SQLServerUniProvider, MemDS, Vcl.Grids, Vcl.DBGrids, Vcl.StdCtrls;

type
  TForm2 = class(TForm)
    Con: TUniConnection;
    InterBaseUniProvider1: TInterBaseUniProvider;
    SQLServerUniProvider1: TSQLServerUniProvider;
    tbServers: TUniTable;
    tbServersID: TLargeintField;
    tbServersDOMAINID: TLargeintField;
    tbServersSERVER: TWideStringField;
    tbServersISDC: TBooleanField;
    tbServersWASONLINE: TBooleanField;
    tbServersOSTYPE: TIntegerField;
    tbServersOSCOMMENT: TWideStringField;
    tbServersOSFLAGS: TIntegerField;
    tbServersEXCLUDEFROMFETCH: TBooleanField;
    tbServersINFETCHDATA: TBooleanField;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    btAddServer: TButton;
    cbServer: TComboBox;
    btConnect: TButton;
    procedure tbServersAfterOpen(DataSet: TDataSet);
    procedure btAddServerClick(Sender: TObject);
    procedure btConnectClick(Sender: TObject);
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.btAddServerClick(Sender: TObject);
begin
//  tbServers.Prepare;
  tbServers.Append;
  tbServersDOMAINID.Value := 1;
  tbServersSERVER.Value := 'Testing_' + Random(MaxInt).ToString;
  tbServersISDC.Value := False;
  tbServers.Post;
  Assert(tbServersID.AsLargeInt > 0);
end;

procedure TForm2.btConnectClick(Sender: TObject);
const cLib = 'C:\ProgramData\My\Firebird\fb3';
begin
  Con.Close;
  Con.SpecificOptions.Values['InterBase.ClientLibrary'] := cLib + {$IFDEF CPUX64}'_(64)' + {$ENDIF}'\fbclient.dll';
  Con.Server := cbServer.Text;
  if Con.Server = '' then Con.Database := ExtractFilePath(Paramstr(0)) + 'TEST.FDB'
  else Con.Database := 'TEST.FDB';
  Con.Connect;
  tbServers.Open;
  Caption := 'Connected';
end;

procedure TForm2.tbServersAfterOpen(DataSet: TDataSet);
begin
//
end;

end
.
Last edited by FredS on Fri 17 Sep 2021 18:37, edited 1 time in total.

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: DMLRefresh Error with 9.01

Post by FredS » Fri 17 Sep 2021 18:21

I've tested on Windows 10 and 7, against a Windows FB-3.07 server and docker: jacobalberty/firebird:3.0.7.

Same issue persists but the error changes depending on Bitness used..

W10 Win64:
Access violation at address 000000005A58C30B in module 'MSVCR100.dll'. Write of address 000000017FFE805E.
Win7-Win32:
unable to allocate memory from operating system.
Should add the 'MSVCR100.dll' used ships with FB-3.07 release..

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: DMLRefresh Error with 9.01

Post by ViktorV » Mon 20 Sep 2021 15:56

Hi Fred,

Thank you for the info provided!
We have successfully reproduced the issue and at the moment our team is investigating it.
Please, rest assured that as soon as we have any results, we will immediately let you know.
Please, let us know if you have any additional questions or need any kind of additional instructions!

Best regards,
Viktor

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: DMLRefresh Error with 9.01

Post by FredS » Tue 16 Nov 2021 18:01

Hi Viktor,

We're coming up to the two month anniversary of this and other reported issues.. any news or updates soon?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: DMLRefresh Error with 9.01

Post by ViktorV » Wed 17 Nov 2021 13:21

Dear Fred!

Kindly be informed that we have fixed the bug you mentioned and its fix will be included in the next build of UniDAC.
We can send you a nightly build that includes this change, so you can check if this change solves the problem on your side.

To do this, please provide us your license number and the version of the IDE you are using via our contact form:
https://devart.com/company/contactform.html

Post Reply