TemporaryLobUpdate default value changed (ORACLE)

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tcxbalage
Posts: 23
Joined: Sat 04 Apr 2020 10:45

TemporaryLobUpdate default value changed (ORACLE)

Post by tcxbalage » Thu 04 Mar 2021 16:48

I think the Oracle's TemporaryLobUpdate default value changed from TRUE to FALSE.
Our codes worked fine fine until the recent version (8.4.1), but now we receive a "Lob locator should be inited." error when a storedproc contains a BLOB/CLOB param.

I found this:
TOracleUniProvider.CreateDataSetOptions >
FDataSetOptions.Add(TBooleanOption.Create('TemporaryLobUpdate', prTemporaryLobUpdate, [TOCICommand], False));
This value was True in the previous version.

Here is what your documantation says:
TemporaryLobUpdate - Enables the use of a temporary LOB to write input and input/output LOB parameter into database when executing dataset's SQL statements. The default value is True.
https://www.devart.com/unidac/docs/using-oracle.htm

You can reproduce the problem whith the following code:
Oracle:

Code: Select all

create or replace function DEMO_PROC(i_file IN BLOB)
return number
as
BEGIN
  return 0;
END;
Delphi:

Code: Select all

  TfrmMain = class(TForm)
    conMain: TUniConnection;
    trMain: TUniTransaction;
    spDemo: TUniStoredProc;
    procedure FormCreate(Sender: TObject);
  private
  public
  end;
...
procedure TfrmMain.FormCreate(Sender: TObject);
var
  xStream: TMemoryStream;
begin
  conMain.Connect;

  spDemo.Prepare;

  xStream := TMemoryStream.Create;
  try
    xStream.Clear;
    xStream.LoadFromFile('c:\any_file.txt');
    spDemo.ParamByName('i_file').LoadFromStream(xStream, ftOraBlob);
  finally
    FreeAndNil(xStream);
  end;

  spDemo.Execute;
end;

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TemporaryLobUpdate default value changed (ORACLE)

Post by MaximG » Mon 08 Mar 2021 22:01

We changed the behavior of our components in the latest version to improve performance, indeed. Your example illustrates that these changes break your application. We'll consider reverting the default value. As a workaround, please set the 'TemporaryLobUpdate' parameter explicitly:

Code: Select all

   spDemo.SpecificOptions.Values['TemporaryLobUpdate'] := 'True';
   spDemo.ParamByName('i_file').LoadFromStream(xStream, ftOraBlob);

tcxbalage
Posts: 23
Joined: Sat 04 Apr 2020 10:45

Re: TemporaryLobUpdate default value changed (ORACLE)

Post by tcxbalage » Tue 09 Mar 2021 00:48

Thanks for the reply.
I already reverted the changes in the source code and rebuilt all the packages, I hope I will not forget to do the same after every new release :)
I do understand this is for the greater good, but this kind of default value change could be problematic, changes the existing codes behaviour unexpectedly.

BTW, what would be the proper usage of the BLOB/CLOB params if this TemporaryLobUpdate is set to False?
I searched for an example code, had no luck to find, I would appreciate if you could show me how to do.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TemporaryLobUpdate default value changed (ORACLE)

Post by MaximG » Thu 11 Mar 2021 14:53

We've changed the behavior of our product. If you'd like to download the nightly build to test the changes, please send us your UniDAC license number and IDE version through https://www.devart.com/company/contactform.html
To observe the difference between various values of TemporaryLobUpdate, you only need to set TemporaryLobUpdate=False and construct a query using SQL Generator at design-time.

tcxbalage
Posts: 23
Joined: Sat 04 Apr 2020 10:45

Re: TemporaryLobUpdate default value changed (ORACLE)

Post by tcxbalage » Wed 17 Mar 2021 08:09

Thanks but there is other issue about the parameters. I will wait until that investigated too.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: TemporaryLobUpdate default value changed (ORACLE)

Post by MaximG » Wed 17 Mar 2021 17:51

Did you report an issue with parameters? We haven't received any messages regarding this matter from you.

tcxbalage
Posts: 23
Joined: Sat 04 Apr 2020 10:45

Re: TemporaryLobUpdate default value changed (ORACLE)

Post by tcxbalage » Fri 16 Apr 2021 08:06

The default parameter has been restored to TRUE in 8.4.3, works fine, thanks for your help.

Post Reply