TOraLoader and Net-option doesn't work

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ac
Posts: 32
Joined: Mon 16 Jan 2006 12:56

TOraLoader and Net-option doesn't work

Post by ac » Thu 06 Apr 2006 12:22

Please find below a test-method which exposes the problem: if we use the Net option we get a "OCI_INVALID_HANDLE" exception (see also comment in the code below).

Please tell me, if this is a bug and if so when it will be fixed. Thanks.

Code: Select all

procedure TTestLoaderNet.TestLoadTable;
const
  CTable = 'TestLoader';
var
  lSession: TOraSession;
  lLoader: TOraLoader;
begin
  lSession := TOraSession.Create(nil);
  try
    lSession.Options.Net := true;
    lSession.Username := //user name;
    lSession.Password := //password;
    lSession.Server := //enter server address here;;
    lSession.Connect;
    Assert(lSession.Connected, 'connected');

    try
      lSession.ExecSQL(
        'CREATE TABLE ' + CTable + ' (' +
        'FI INTEGER' +
        ')', []);
    except
      on E: EOraError do begin
        if (E.ErrorCode = 955) then //table exists
          lSession.ExecSQL('DELETE FROM ' + CTable, [])
        else
          raise;
      end;
    end;

    lLoader := TOraLoader.Create(nil);
    try
      lLoader.Session := lSession;
      lLoader.TableName := CTable;
      lLoader.OnPutData := PutData;
      //BUG: can't load if Net = True (datatype is not supported)
      //TOraLoader: Prepare: OCIHandleAlloc -> 
      //Res: OCI_INVALID_HANDLE
      lLoader.Load;
    finally
      FreeAndNil(lLoader);
    end;
  finally
    FreeAndNil(lSession);
  end;
end;

procedure TTestLoaderNet.PutData(Sender: TOraLoader);
var
  Row: Integer;
begin
  for Row := 1 to 10 do begin
    Sender.PutColumnData(0, Row, { FI } Row);
  end;
end;

ac
Posts: 32
Joined: Mon 16 Jan 2006 12:56

Post by ac » Thu 06 Apr 2006 12:27

hint: if I set Net := False, then the example method works.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Mon 10 Apr 2006 09:50

Direct path loading is not supported with Net option. We substitute the OCI_INVALID_HANDLE error with user-friendly error message.

ac
Posts: 32
Joined: Mon 16 Jan 2006 12:56

Post by ac » Mon 10 Apr 2006 12:47

Thank you for the information.

Post Reply