DOA 3.3.3 CBuilder5 : Not looged on. DLLs

rakgol_a

Member²
Hi,

I'm passing a session to a dll, @ runtime
the DLL complain about "Not logged on".
I'm using this code.

OracleSession1->ExternalSVC = oraSession->ExternalSVC;

where OracleSession1 is the DLL session.

Any ideas? Thanx in advance Alfred
 
Perhaps oraSession->ExternalSVC is NULL? This would imply that this session is not connected.

------------------
Marco Kalter
Allround Automations
 
How is that possible if u check for

if(oraSession->Connected)
{
OracleSession1->ExternalSVC = oraSession->ExternalSVC;
}
else
{
try
{
oraSession->Connected = true;
OracleSession1->ExternalSVC = oraSession->ExternalSVC;
}
catch(EOracleException & err)
{
logError(err);
throw;
}
}

Originally posted by mkalter:
Perhaps oraSession->ExternalSVC is NULL? This would imply that this session is not connected.

 
Perhaps the session is using OCI7 mode? In that case the ExternalSVC will always be NULL. You can use TOracleSession.Share, which checks for OCI7 (SQL*Net 2.x) or OCI8 (Net8), and subsequently assigns the ExternalLDA or ExternalSVC.

------------------
Marco Kalter
Allround Automations
 
If u don't mind can be give some
code on how this TOracleSession.Share
work. The help file and the documentation
does not have any info on this method,
eventhough is valid.

thanx

Originally posted by mkalter:
Perhaps the session is using OCI7 mode? In that case the ExternalSVC will always be NULL. You can use TOracleSession.Share, which checks for OCI7 (SQL*Net 2.x) or OCI8 (Net8), and subsequently assigns the ExternalLDA or ExternalSVC.

 
In 3.3.3 this was indeed not yet documented. In 3.4.x the documentation is:

Declaration
procedure Share(ToSession: TOracleSession);

Description
Shares the physical database connection of the session with another session. The TOracleSession instance for which this procedure is called must be connected. This procedure is useful if you are using dynamic link libraries and want to share a session between a host application and a DLL, if both are using Direct Oracle Access. For other scenarios you need to use the ExternalLDA or ExternalSVC properties.

Warning: You must log off the session to which the host session is shared, before the host session itself is logged off.

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