Page 1 of 2

9.6.20 Unknown error 1 in Direct Mode

Posted: Tue 29 Sep 2015 08:32
by VadimShvarts
Hello
ODAC 9.6.20
Delphi XE8
Oracle 11.2.0.3.0

We have got error: "Unknown error 1"

Error stack:

Code: Select all

exception number   : 1
exception class    : EOraError
exception message  : Unknown error 1.

main thread ($1f10):
0083de22 +1ca Project17.exe OraClasses      2403  +48 TOCIConnection.OraError
00867831 +02d Project17.exe OraClasses     17759   +2 TOCITransaction.Check
00868408 +0b0 Project17.exe OraClasses     17950  +12 TOCITransaction.CommitLocal
00867f5f +023 Project17.exe OraClasses     17889   +1 TOCITransaction.StartTransactionLocal
00868ac8 +108 Project17.exe OraClasses     18091  +14 TOCITransaction.StartTransaction
007c33c5 +121 Project17.exe DBAccess       17799  +25 TDATransaction.StartTransaction
0087c04c +090 Project17.exe OraTransaction   369  +12 TOraTransaction.StartTransaction
0087bfb4 +00c Project17.exe OraTransaction   353   +1 TOraTransaction.StartTransaction
008897b6 +05a Project17.exe Ora             2554   +7 TOraSession.StartTransaction
00889754 +010 Project17.exe Ora             2541   +1 TOraSession.StartTransaction
008aa4be +03e Project17.exe Unit13            48   +2 TForm13.Button1Click
00656a67 +073 Project17.exe Vcl.Controls    7361   +9 TControl.Click
005a541a +01e Project17.exe Vcl.StdCtrls    5327   +3 TCustomButton.Click
005a5f28 +010 Project17.exe Vcl.StdCtrls    5788   +1 TCustomButton.CNCommand
006564f9 +2bd Project17.exe Vcl.Controls    7245  +91 TControl.WndProc
0065b0a1 +5e9 Project17.exe Vcl.Controls   10079 +158 TWinControl.WndProc
005a50c4 +06c Project17.exe Vcl.StdCtrls    5164  +13 TButtonControl.WndProc
00656134 +024 Project17.exe Vcl.Controls    7023  +10 TControl.Perform
0065b207 +023 Project17.exe Vcl.Controls   10148  +12 DoControlMsg
0065bc8f +00b Project17.exe Vcl.Controls   10423   +1 TWinControl.WMCommand
006564f9 +2bd Project17.exe Vcl.Controls    7245  +91 TControl.WndProc
0065b0a1 +5e9 Project17.exe Vcl.Controls   10079 +158 TWinControl.WndProc
0065a6c0 +02c Project17.exe Vcl.Controls    9786   +3 TWinControl.MainWndProc
00534e80 +014 Project17.exe System.Classes 16882   +8 StdWndProc
77433a2e +13e user32.dll                              SendMessageW
77434522 +092 user32.dll                              CallWindowProcW
0065b1b2 +0e6 Project17.exe Vcl.Controls   10120  +30 TWinControl.DefaultHandler
00656ebc +010 Project17.exe Vcl.Controls    7494   +1 TControl.WMLButtonUp
006564f9 +2bd Project17.exe Vcl.Controls    7245  +91 TControl.WndProc
0065b0a1 +5e9 Project17.exe Vcl.Controls   10079 +158 TWinControl.WndProc
005a50c4 +06c Project17.exe Vcl.StdCtrls    5164  +13 TButtonControl.WndProc
0065a6c0 +02c Project17.exe Vcl.Controls    9786   +3 TWinControl.MainWndProc
00534e80 +014 Project17.exe System.Classes 16882   +8 StdWndProc
77433e4b +00b user32.dll                              DispatchMessageW
0062cb43 +0f3 Project17.exe Vcl.Forms      10421  +23 TApplication.ProcessMessage
0062cb86 +00a Project17.exe Vcl.Forms      10451   +1 TApplication.HandleMessage
0062ceb9 +0c9 Project17.exe Vcl.Forms      10589  +26 TApplication.Run
008badb9 +049 Project17.exe Project17         17   +4 initialization
76eb3742 +022 KERNEL32.DLL                            BaseThreadInitThunk
Project17.dpr

Code: Select all

program Project17;

uses
  madExcept,
  madLinkDisAsm,
  Vcl.Forms,
  Unit13 in 'Unit13.pas' {Form13};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm13, Form13);
  Application.Run;
end.
Unit13.dfm

Code: Select all

object Form13: TForm13
  Left = 0
  Top = 0
  Caption = 'Form13'
  ClientHeight = 299
  ClientWidth = 635
  Color = clBtnFace
  ParentFont = True
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object DBGrid1: TDBGrid
    Left = 0
    Top = 0
    Width = 635
    Height = 232
    Align = alClient
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'Tahoma'
    TitleFont.Style = []
  end
  object Panel1: TPanel
    Left = 0
    Top = 232
    Width = 635
    Height = 67
    Align = alBottom
    TabOrder = 1
    object Button1: TButton
      Left = 264
      Top = 24
      Width = 75
      Height = 25
      Caption = 'Button1'
      TabOrder = 0
      OnClick = Button1Click
    end
  end
  object OraSession1: TOraSession
    Options.Direct = True
    AutoCommit = False
    Left = 96
    Top = 48
  end
  object OraTransaction1: TOraTransaction
    DefaultSession = OraSession1
    Left = 192
    Top = 48
  end
  object SmartQuery1: TSmartQuery
    UpdatingTable = 'EMP'
    KeyFields = 'EMPNO'
    Session = OraSession1
    SQL.Strings = (
      'select * from emp'
      'where ENAME like :ENAME')
    LockMode = lmNone
    Left = 296
    Top = 32
    ParamData = <
      item
        DataType = ftString
        Name = 'ENAME'
        Value = ''
      end>
  end
  object DataSource1: TDataSource
    DataSet = OraQuery2
    Left = 104
    Top = 112
  end
  object OraQuery2: TOraQuery
    Session = OraSession1
    SQL.Strings = (
      'select * from emp')
    Active = True
    Left = 448
    Top = 80
  end
end
Unit13.pas

Code: Select all

unit Unit13;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.StdCtrls, Vcl.ExtCtrls,
  Vcl.Grids, Vcl.DBGrids, MemDS, DBAccess, Ora, OraTransaction, OraCall,
  OraSmart, odacvcl;

type
  TForm13 = class(TForm)
    OraSession1: TOraSession;
    OraTransaction1: TOraTransaction;
    SmartQuery1: TSmartQuery;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    Panel1: TPanel;
    Button1: TButton;
    OraQuery2: TOraQuery;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  end;

var
  Form13: TForm13;

implementation

{$R *.dfm}

procedure TForm13.Button1Click(Sender: TObject);
begin
 try
  OraSession1.StartTransaction;
  try
   if not SmartQuery1.Prepared then
    SmartQuery1.Prepare;
   SmartQuery1.ParamByName('ENAME').AsString := '%A%';
   SmartQuery1.Open;
   SmartQuery1.Edit;
   SmartQuery1.FieldByName('ENAME').AsString := 'test'+ SmartQuery1.FieldByName('ENAME').AsString;
   SmartQuery1.Post;
   OraSession1.Commit;
  except
   OraSession1.Rollback;
   raise;
  end;
 finally
  SmartQuery1.Close;
 end;
 OraQuery2.Close;
 OraQuery2.Open;
end;

procedure TForm13.FormCreate(Sender: TObject);
begin
 OraSession1.Open;
 OraQuery2.Open;
end;

end.
Step to reproduce error:
Run application on remote db server (we have CISCO routers and CheckPoint gateways between client and server)
Wait minimum 1 hour
Click "Button1" -> Unknown error 1

if Oracle Database run on localhost all work fine
if use ODAC 9.5.15 all work fine on remote db and local db
if use ODAC 9.5.16 error the same

Thanks

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Mon 05 Oct 2015 10:56
by AlexP
Please check server connection stability (during this period), and that the server itself doesn't destroy inactive sessions.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Mon 05 Oct 2015 11:35
by VadimShvarts
AlexP wrote:Please check server connection stability (during this period), and that the server itself doesn't destroy inactive sessions.
If use ODAC version 9.5.15 all work fine
I can send traffic log from client pc

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Tue 06 Oct 2015 07:43
by AlexP
Even on connection loss (physical or on the server side) we can't reproduce the described case. Please send the log to alexp*devart*com.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Tue 06 Oct 2015 14:54
by VadimShvarts
AlexP wrote:Even on connection loss (physical or on the server side) we can't reproduce the described case. Please send the log to alexp*devart*com.
Send logs to mail

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Mon 12 Oct 2015 11:23
by AlexP
Unfortunately, the log you have sent didn't help detect the problem. And the sample doesn't reproduce the error on our severs.
We suppose that the error may occur on connection loss or session destruction. Please try to use the OnConnectionLost event for reconnect attempt and let us know the result.
P.S. In addition, check the session status on the server before executing your sample.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Mon 12 Oct 2015 13:51
by VadimShvarts
AlexP wrote:Unfortunately, the log you have sent didn't help detect the problem. And the sample doesn't reproduce the error on our severs.
We suppose that the error may occur on connection loss or session destruction. Please try to use the OnConnectionLost event for reconnect attempt and let us know the result.
P.S. In addition, check the session status on the server before executing your sample.
OnConnectionLost event not executed
On ORACLE in v$session view this session no different from other.

Analysis of the log files:
Procedure "OraSession1.StartTransaction" causes "Connection.OCI8.OCITransCommit" and that, in turn, sends to the server a command without error, so the network connection is not lost.

The problem is in processing the response from the server when issuing the command StartTransaction after a certain period of inactivity.

Version 9.5.15 was the loop handling response from the server.
In version 9.6.20 there is no cycle of this treatment.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Tue 13 Oct 2015 11:04
by VadimShvarts
We change button handler (now just OraQuery2.Close; OraQuery2.Open;)
On our server enough 20 minute wait to receive the error.

Project1.dpr

Code: Select all

program Project1;

uses
  Vcl.Forms,
  Unit1 in 'Unit1.pas' {Form13};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm13, Form13);
  Application.Run;
end.
Unit1.dfm

Code: Select all

object Form13: TForm13
  Left = 0
  Top = 0
  Caption = 'Form13'
  ClientHeight = 299
  ClientWidth = 635
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object DBGrid1: TDBGrid
    Left = 0
    Top = 0
    Width = 635
    Height = 232
    Align = alClient
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'Tahoma'
    TitleFont.Style = []
  end
  object Panel1: TPanel
    Left = 0
    Top = 232
    Width = 635
    Height = 67
    Align = alBottom
    TabOrder = 1
    object Button2: TButton
      Left = 360
      Top = 24
      Width = 75
      Height = 25
      Caption = 'Button2'
      TabOrder = 0
      OnClick = Button2Click
    end
  end
  object OraSession1: TOraSession
    Options.Direct = True
    AutoCommit = False
    OnConnectionLost = OraSession1ConnectionLost
    Left = 96
    Top = 48
  end
  object OraTransaction1: TOraTransaction
    DefaultSession = OraSession1
    Left = 192
    Top = 48
  end
  object DataSource1: TDataSource
    DataSet = OraQuery2
    Left = 104
    Top = 112
  end
  object OraQuery2: TOraQuery
    Session = OraSession1
    SQL.Strings = (
      'select * from emp')
    Left = 448
    Top = 80
  end
  object OraSQLMonitor1: TOraSQLMonitor
    Left = 480
    Top = 24
  end
end
unit1.pas

Code: Select all

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.StdCtrls, Vcl.ExtCtrls,
  Vcl.Grids, Vcl.DBGrids, MemDS, DBAccess, Ora, OraTransaction, OraCall,
  OraSmart, DASQLMonitor, OraSQLMonitor, odacvcl, OraNet, MemData;

type
  TForm13 = class(TForm)
    OraSession1: TOraSession;
    OraTransaction1: TOraTransaction;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    Panel1: TPanel;
    OraQuery2: TOraQuery;
    OraSQLMonitor1: TOraSQLMonitor;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure OraSession1ConnectionLost(Sender: TObject; Component: TComponent;
      ConnLostCause: TConnLostCause; var RetryMode: TRetryMode);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form13: TForm13;

implementation

{$R *.dfm}

procedure TForm13.Button2Click(Sender: TObject);
begin
 OraQuery2.Close;
 OraQuery2.Open;
end;

procedure TForm13.FormCreate(Sender: TObject);
begin
 OraSession1.Open;
 OraQuery2.Open;
 Caption := Application.ExeName;
end;

procedure TForm13.OraSession1ConnectionLost(Sender: TObject;
  Component: TComponent; ConnLostCause: TConnLostCause;
  var RetryMode: TRetryMode);
begin
 RetryMode := rmReconnectExecute;
end;

end.
The difference in network traffic is again (as in the case with StartTransaction) in a cyclic reading of the result from the server in ODAC 9.5.15 and single reading in ODAC 9.6.20

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Thu 15 Oct 2015 11:37
by AlexP
We ran your projects several times in different intervals (from 20 minutes to 2 hours) - and the problem is not reproduced on our servers. Unfortunately, we can't fix the problem without having reproduced it. If you could give us access to your server, we would try to reproduce the problem on it.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Mon 19 Oct 2015 11:35
by VadimShvarts
Send example to mail

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Mon 19 Oct 2015 13:21
by AlexP
We have reproduced the problem only on your server, therefore please don't close access in order for us to investigate the reasons for the error occurrence more deeply.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Tue 20 Oct 2015 11:40
by AlexP
Your Oracle server stopped responding (ping is successful, tnsping - no). Please check status of your server and listener.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Thu 03 Dec 2015 13:28
by dados
Hi, I'm also getting that Unknown error 1 in Direct Mode after upgrading to 9.6.20
I'm connecting to the same servers as before and nothing has changed in my code except from the ODAC upgrade.

I downgraded ODAC to 9.6.19 and i'm Unknown error 1 free so it seems to something that came with the 9.6.20 version

NET: List index out of bounds (0) is also another error i'm getting with 9.6.20

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Fri 04 Dec 2015 06:32
by AlexP
>Unknown error 1 in Direct Mode
We have already fixed the problem.

>List index out of bounds (0)
Please clarify, when this error occurs, and describe the steps to reproduce it.

Re: 9.6.20 Unknown error 1 in Direct Mode

Posted: Fri 04 Dec 2015 13:32
by dados
Excellent on fixing the error 1 problem, thanks.
Is there a new ODAC version that I can download for the fix?

The List index out of bounds (0) error has only occurred a few times. If I'm able to reproduce it I will let you know.

Thanks