Sharing TOracleSession

bchau

Member²
Hi,

I use the TOracleSession component in my Main.exe to connect to
Oracle's Database.
The issue I have is I want other executable files(3 or more) to share the same TOracleSession. I try Memory Mapping File & TMemoryStream method, Store the component in the Dll, and so far I have no luck.
Any idea or solution would be appreciated.

Thanx in advance... Bryan
 
Are we talking EXE loading DLLs?

If yes, here are the steps:
1. After successfully connecting to the database, you store ExternalLDA in a pointer variable.
2. In the DLL you create another OracleSession.
3. Your EXE talks to the DLL via LoadLibrary and GetProcAddress.
4. You pass your ExternalLDA pointer to the DLL.
5. In the FormCreate of the DLL, you assign the ExternalLDA from the EXE to the OracleSession's ExternalLDA in the DLL.

Et voila!

Let me know if you need some commented code.
 
Thanks, I've done a lot of Exe calling Dll application and share the same TOracleSession. But what I need to figure out is how to share the same TOracleSession with other Exe1, Exe2, Exe(s).
The issue is I want to be able to share one TOracleSession in the main.Exe with other multiple Exe; someone suggest to use a 3 tiers method, but I am sure how to approach it. Can someone send me some example?
 
Back
Top