Page 1 of 1

ConnectionTimeOut

Posted: Tue 29 Jun 2010 23:09
by Valgardur
I'm trying to set ConnectionTimeout to short value, 4 seconds for example, in direct mode, but timeout is always close to 26 seconds.. the same applies to pinging.

Any ideas?

Posted: Wed 30 Jun 2010 14:02
by bork
Hello

Unfortunately I cannot reproduce your issue. Please provide exact ODAC version that you are using (for example 6.90.0.59).

Posted: Wed 30 Jun 2010 16:56
by Valgardur
Odac 6.90.0.59 for Delphi 2010 for Win32

Another very strange, possibly related, behavior ...

If I set LoginPrompt to true (and add DbLogDlg) I get login window when I set my connection to true in Delphi environment. But when I run my application there is no login dialog.. so if I provide username and password I can connect, if not I get an error that there is no information...

Posted: Thu 01 Jul 2010 13:15
by bork
Please provide us the Oracle error code that you get when connection cannot be established during 26 seconds.

To show login dialog you should add the OdacVcl unit to the USES section of the unit where your TOraSession is located.

Posted: Thu 01 Jul 2010 18:47
by Valgardur
Thanks, I don't get an oracle error code as the Oracle server is not available.

All I get is EoraError: "NET: Connection timed out"

The OdacVcl works (but according to the documentation I should add "DbLogDlg")

Posted: Mon 05 Jul 2010 21:32
by Valgardur
Still nothing on this??

Posted: Tue 06 Jul 2010 06:59
by bork
Hello

I tired to enter invalid host name, invalid IP, invalid port number, invalid SID, break connection, but always connection timeout was correct. Please give a detailed description of the case when connection timeout is 26 seconds and it cannot be changed. And please provide me the exact value of the TOraSession.Option.ConnectionTimeOut property.

Also you can open "Using UniDAC -> Writing GUI Applications with ODAC" section of the ODAC help and read the following information:
Since version 3.80 ODAC GUI part is standalone. This means that to make GUI elements such as SQL cursors, connect form, connect dialog etc. available, you should explicitly include OdacVcl (OdacClx under Linux) unit to your application.

Posted: Mon 12 Jul 2010 19:31
by Valgardur
I have a TOraSession on my DataModule. Server, Username and Password are set – I use default values except Direct is True and KeepDesignConnection is False. I have tried various values for „ConnectionTimeout“. On the DataModule:
DBIsl.Connected := False;
And when I try to connect, on user request:

Screen.Cursor := crHourGlass;
try
try
FGogn.DBIsl.Connected := True;
except
end;
finally
Screen.Cursor := crDefault;
end;

Posted: Tue 13 Jul 2010 15:18
by bork
Hello

I cannot reproduce your issue. Please try to reproduce your issue in a new empty application. Create a new application, add a new button and add the following code on the button click event:

Code: Select all

var
  MySession: TOraSession;
  start_time, finish_time: TDateTime;
begin
  MySession := TOraSession.Create(self);
  MySession.Options.Direct := True;
  MySession.Options.ConnectionTimeout := 1000;
  MySession.Username := ...;
  MySession.Password := ...;
  MySession.Server := ...;

  Screen.Cursor := crHourGlass;
  start_time := Now;
  try
    try
      MySession.Connected := True;
    except
    end;
  finally
    finish_time := Now;
    Screen.Cursor := crDefault;
    MySession.Destroy;

    ShowMessage('Connection timeout is: ' + FloatToStr((finish_time - start_time) * 24 * 60 * 60) + ' sec.');
  end;
end;
And please provide me the result of executing this code. If in this code connection timeout is working correctly then please modify this code to reproduce your issue. Probably you are trying to connect several times repeatedly and it is the cause of this issue.

Posted: Tue 13 Jul 2010 17:47
by Valgardur
Hi, no I'm not trying to connect several times.

It takes 21 seconds for timeout to appear, I tried a few times, 21.0... was the displayed result.

Connection took 0.2 .. 0.3 seconds when server was available.

However, I believe I have found the root of the problem.

I am connecting directly to an IP address, when I use the server name, the connection timeout is close enough, the display in your test is 2.2 seconds.

Posted: Wed 14 Jul 2010 11:12
by bork
Hello

It is good to see that this problem has been solved.

I reproduced this issue for the case when server is defined as direct IP address. But it is not the only condition. Second condition is FireWall that is turned on, it blocks socket and doesn't allow closing it when connection time is out. If I turn off FireWall then connection timeout works correctly.

We will try to fix it but it can take a lot of time and we cannot guarantee success.

Posted: Wed 14 Jul 2010 11:42
by Valgardur
Thanks, I can, of course, circumvent this, but in one project, using the IP address is a bonus.