Problems con TOracleSession.Logon

Carlos

Member
We have one DLL that is connecting every 30 seconds with Oracle 8.1.5.

Usually, DLL keeps on trying to connect to DB during cold backup. After DB
 
Does it hang, or does it simply take a very long time before the Logon procedure comes back? If the DLL was connected before the shutdown, the Logon procedure must first disconnect the killed session. Note that you can use TOracleSession.CheckConnection to find out if a session is still alive.

------------------
Marco Kalter
Allround Automations
 
Hi mkalter,

We think that the connection is finished when Logon method try to connect again. I send you the code where Dll hangs.

Anyway, if the connection is still alive, how can we fix the problem?

Thanks in advance

LogEvent('Funcion OpenSession: apertura de conexion.');
with OracleSession do
try
if Connected then
begin
LogEvent('Antes del LogOff');
LogOff;
LogEvent('Despues del LogOff');
end;
LogonDatabase := GeneralIni.ReadString( 'DB', 'DBOraName', '' );
LogonUserName := Decodifica(GeneralIni.ReadString( 'DB', 'DBUser', '' ));
LogonPassword := Decodifica(GeneralIni.ReadString( 'DB', 'DBPassword', '' ));
LogEvent('Datos de conexion: ' + LogonDatabase + ' ' + LogonUserName + ' ' + LogonPassword);
LogOn;
LogEvent('Tras el LogOn');
except
on E: Exception do begin
LogEvent('Ha habido un error');
ConsultasEfectuadas := [];
LogEvent( 'No se pudo establecer comunicaci
 
Are you saying that the LogOff finishes without an exception, and that LogOn hangs? Or could it be that Connected is already False?

------------------
Marco Kalter
Allround Automations
 
Hi Marco and Happy New Year,

Sometimes logoff method finishes without an exception and others it finishes with exception, depending uppon BD shutdown and logoff code execution coincide.

Sum up, these are the steps:

- Dll always runs and every 30 seconds disconnect, connect and query BD.
- Shutdown BD.
- Any part of code fails when tries to disconnect, connect or query BD.
- Every 10 seconds Dll tries Logon with BD and it cann
 
Okay, let's assume that the OCI (Oracle Call Interface) for some reason has a problem reconnecting to this database instance. You can try to completely unload OCI by calling the DLLExit procedure within the OracleCI unit. Include this unit and call DLLExit before calling LogOn (which will automatically reload OCI).

------------------
Marco Kalter
Allround Automations
 
Hi marco,
We have done what you propose, but the problem still appears . Do you know any buffer exists and if we have to reset it? Now we think that DLL processes a lot of connections and by every connection it leaves some buffer full.
 
I can't imagine that we can do anything more than unloading the Net8 DLL. Maybe it is a server problem.

------------------
Marco Kalter
Allround Automations
 
Back
Top