I am using the EF ObjectContext in a C++ application (via COM) - I wrapped the context in an exposed class to COM in .NET - and once I finish with the COM object, I uninitialize COM (CoUninitialize();) and the finalizer of the wrapped class is called where I do a context.Dispose(); context = null;.
My problem is that the connection status (select username,program,machine,status FROM V$SESSION where username is not null;) is INACTIVE after disposing the context and this causes problems when the number of licenses is reached.
How can I force the connection to close?
ODP uses connection pooling by default; if you want to turn it off, add "pooling=false" to your connect string.
Note that this will result in slower performance as apart from having to open a hard connection every time you call con.Open, it also disables things like statement caching.