TOracleDirectPathLoader hangs up on Load method

Mego

Member
Hi,

I have a table like this:
create table e_dpldr(s1 varchar2(4000), s2 varchar2(4000))

After calling GetDefaultColumns(True) and Prepare methods, MaxRows property is 64 (BufferSize is 65536, by default).
And when I call Load(64) method, my app hangs up.

If I change BufferSize to Maxint, MaxRows property becomes 1310 and Load(300) executes succesfully.

MaxRows seems to be less than 64 while BufferSize=65536.
How can I solve this hang up problem?

DOA 4.1.2, Delphi 2010, OraClient 9.2.0.1 & 9.2.0.8

Thanks.
 
This code is based on the example in "Direct Oracle Access 4.1 - User's Guide", pg 202:

var
i : integer;
dpl : TOracleDirectPathLoader;
iRow : Integer;
s1 : AnsiString;
const
ciRowCount = 300; //total data rows to be imported
begin
SetLength(s1, 4000);
for i := 1 to 4000 do
s1 := 'A';


// Create a Loader at run time
dpl := TOracleDirectPathLoader.Create(nil);
//dpl.BufferSize := maxint; //leave the default buffer size
try
// Set the session and table name
dpl.Session := oses_1; // oses_1 is connected already
dpl.TableName := 'e_dpldr'; //create table e_dpldr(s1 varchar2(4000), s2 varchar2(4000));

// Get the default columns for the record_data table
dpl.GetDefaultColumns(True);
// Prepare the dpl
dpl.Prepare;
ShowMessage(inttostr(dpl.MaxRows));
// Process all data in batches of records
iRow := 0;
for i := 0 to ciRowCount - 1 do begin
// Copy one record to the array
dpl.Columns[0].SetData(iRow, @s1[1], Length(s1));
dpl.Columns[1].SetData(iRow, @s1[1], Length(s1));

Inc(iRow);
// The array is filled, or we have preocessed all records:
// load this batch of records
if (iRow = dpl.MaxRows) or (i = ciRowCount - 1) then begin
try
dpl.Load(iRow); //program hangs up here !!! dpl.BufferSize needs to be set for "maxint"
except
// In case of an error: show where things went wrong
// and abort the load operation
on E:EOracleError do begin
ShowMessage(E.Message + #13#10 + 'Row = ' + IntToStr(dpl.LastRow) + #13#10 + 'Col = ' + IntToStr(dpl.LastColumn));
dpl.Abort;
raise;
end;
end;
iRow := 0;
end;
end;
// Commit the loaded data
dpl.Finish;
finally
dpl.Free;
end;
end;
 
Unfortunately not.
I tried to load a text file (1474 lines, 80 chars "A" per line, file size = 120866 bytes) via the DirectPathDemo project.
The result is the same, app still hangs.
But, a file with 1473 lines was loaded succesfully multiple times.

Loader.MaxRows=1545 in both cases
:(
 
Back
Top