Page 1 of 1

TemporaryLobUpdate default value changed (ORACLE)

Posted: Thu 04 Mar 2021 16:48
by tcxbalage
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;

Re: TemporaryLobUpdate default value changed (ORACLE)

Posted: Mon 08 Mar 2021 22:01
by MaximG
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);

Re: TemporaryLobUpdate default value changed (ORACLE)

Posted: Tue 09 Mar 2021 00:48
by tcxbalage
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.

Re: TemporaryLobUpdate default value changed (ORACLE)

Posted: Thu 11 Mar 2021 14:53
by MaximG
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.

Re: TemporaryLobUpdate default value changed (ORACLE)

Posted: Wed 17 Mar 2021 08:09
by tcxbalage
Thanks but there is other issue about the parameters. I will wait until that investigated too.

Re: TemporaryLobUpdate default value changed (ORACLE)

Posted: Wed 17 Mar 2021 17:51
by MaximG
Did you report an issue with parameters? We haven't received any messages regarding this matter from you.

Re: TemporaryLobUpdate default value changed (ORACLE)

Posted: Fri 16 Apr 2021 08:06
by tcxbalage
The default parameter has been restored to TRUE in 8.4.3, works fine, thanks for your help.