Corrupt Blob Data after inserting in 12c database

Corrupt Blob Data after inserting in 12c database

Postby bps » Fri 02 Oct 2015 11:33

Hi,
i am using your driver (v 6.5.8.) in an application via direct mode now for some years with an oracle 10.2.0.1 database on windows 2003 server (32Bit).
In our application we can add external documents into a blob field.

After an upgrade to oracle 12c on a new hardware under oracle linux 7 (64Bit) with charset AL32UTF8 the old BLOB Data will be loaded correct. But when we insert new documents (per example pdf files or images) the data will be stored corrupt in the database blob field. You can see the size of the inserted binary data is increased.

In several positions of the exported corrupted binary stream, blocks ob NULL values are inserted followed by the original data.

It seems to me, a stream buffer, initialized with NULL values will be copied wrong inside the driver.

The current available version also will not work.
Here the code of a simple test program:

Connection Properties:
DriverUnit=DbxDevartOracle
DriverAssemblyLoader=Devart.DbxOda.DriverLoader.TCRDynalinkDriverLoader,Devart.DbxOda.DriverLoader,Version=15.0.0.1,Culture=neutral,PublicKeyToken=09af7300eec23701
MetaDataAssemblyLoader=Devart.DbxOda.DriverLoader.TDBXDevartOracleMetaDataCommandFactory,Devart.DbxOda.DriverLoader,Version=15.0.0.1,Culture=neutral,PublicKeyToken=09af7300eec23701
DriverPackageLoader=TDBXDynalinkDriverLoader,DBXCommonDriver150.bpl
MetaDataPackageLoader=TDBXDevartOracleMetaDataCommandFactory,DbxDevartOracleDriver150.bpl
ProductName=DevartOracle
GetDriverFunc=getSQLDriverORADirect
LibraryName=dbexpoda40.dll
VendorLib=dbexpoda40.dll
MaxBlobSize=-1
LocaleCode=0000
Oracle TransIsolation=ReadCommitted
RoleName=Normal
LongStrings=True
EnableBCD=True
UseQuoteChar=False
CharLength=0
UseUnicode=True
UnicodeEnvironment=False
IPVersion=IPv4
Database=xxx
Password=xxx
User_Name=xxx

Source Code (XE):
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
  lFileStream: TFileStream;
  SQL: String;
  lParams: TParams;
begin
  SQLConnection1.Open;
  OpenDialog1.Filter:='All Files(*.*)|*.*';
  if OpenDialog1.Execute then
  begin
    lFileStream := TFileStream.Create(OpenDialog1.FileName, fmOpenRead or fmShareDenyWrite);
    lFileStream.Seek(0,soFromBeginning);

    SQL := 'INSERT INTO TEST_BLOB_DATA(ID,BDATA) VALUES (1, empty_blob()) RETURNING BDATA INTO :ATAPAR';
    lParams := TParams.Create();
    lParams.Clear;
    lParams.CreateParam(ftOraBlob, 'BDATA', ptInput);
    lParams.ParamByName('BDATA').DataType := ftOraBlob;
    lParams.ParamByName('BDATA').ParamType := ptInput;
    lParams.ParamByName('BDATA').LoadFromStream(lFileStream, ftOraBlob);
    SQLConnection1.Execute(SQL, lParams);
  end;
  SQLConnection1.Close;
end;


Thank you in advanced
Claudio
bps
 
Posts: 2
Joined: Fri 02 Oct 2015 09:22

Re: Corrupt Blob Data after inserting in 12c database

Postby AlexP » Mon 05 Oct 2015 08:58

Hello,

Thank you for the sample, we have reproduced the described problem and will investigate the reason for such behavior.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Corrupt Blob Data after inserting in 12c database

Postby bps » Fri 16 Oct 2015 09:06

AlexP wrote:Hello,

Thank you for the sample, we have reproduced the described problem and will investigate the reason for such behavior.


Hello Alex,
any news?? My customers are asking constantly for a solution...
Thank You
Claudio
bps
 
Posts: 2
Joined: Fri 02 Oct 2015 09:22

Re: Corrupt Blob Data after inserting in 12c database

Postby AlexP » Fri 16 Oct 2015 09:46

Hello,

We have already fixed the problem, and we can send you a night build in order for you to check this case on your sample. For this, please send your license number to alexp*devart*com .
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35


Return to dbExpress driver for Oracle