I get error if I safe data into BLOB field and TOracleSession.ThreadSafe = True.
Oracle 8.1.7.4, DOA 3.4.6.4
Parallel option in Oracle does not set.
So I change it to False - All works. I suspect, that so Oracle works.
Here is code extract :
osess := TOracleSession.Create(nil);
try
osess.ThreadSafe := False; !!!!
// if osess.ThreadSafe := True, you later get error !!!
osess.LogonDatabase := ....
osess.LogonUsername := ....
osess.LogonPassword := ....
osess.Connected := True;
with TOracleQuery.Create(nil) do begin
try
Session := osess;
SQL.Add('BEGIN');
SQL.Add(' UPDATE IMAGE_0 SET TP = :TP WHERE CD_F = :CD_F AND NUM_L = :NUM_L;');
SQL.Add(' IF SQL%ROWCOUNT = 0 THEN');
SQL.Add(' INSERT INTO IMAGE_0(CD_F, NUM_L, TP) VALUES

CD_F, :NUM_L, :TP);');
SQL.Add(' END IF;');
SQL.Add('END;');
DeclareVariable('CD_F', otInteger);
DeclareVariable('NUM_L', otInteger);
DeclareVariable('TP', otInteger);
SetVariable('CD_F', cd_f);
SetVariable('NUM_L', num_l);
SetVariable('TP', p_tp); // 1 - PCL_BMP, 0 - Undefined
Execute;
Clear;
DeleteVariable('TP');
LOB := TLOBLocator.Create(osess, otBLOB);
try
SQL.Add('UPDATE IMAGE_0 SET IMAGE = Empty_blob()');
SQL.Add('WHERE CD_F = :CD_F AND NUM_L = :NUM_L');
SQL.Add(' RETURNING IMAGE INTO :IMAGE');
DeclareVariable('IMAGE', otBlob);
MyStream.Seek(0,0);
SetLongVariable('IMAGE', MyStream.Memory, MyStream.Size);
SetComplexVariable('IMAGE', LOB);
Execute;
MyStream.Seek(0,0);
MyStream.SaveToStream(LOB);
Session.Commit; // you get here error, if ThreadSafe = True !!
finally
LOB.Free;
except
end;
finally
Free;
end;