[Mono-bugs] [Bug 421491] "Could not allocate new OCI Handle of type Statement" message when accessing Oracle

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 16 00:18:37 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=421491

https://bugzilla.novell.com/show_bug.cgi?id=421491#c22


--- Comment #22 from Daniel Morgan <monodanmorg at yahoo.com> 2011-08-16 04:18:32 UTC ---
I had a misunderstanding of the activeConnections variable.  You cleared it up.

The problem that caused the original error was the oci handles that make up an
oracle connection (OciEnvironmentHandle, error handle, service context, server
handle, session handle) had their unmanaged resources (actual OCI handles)
freed because the finalizers on them were called by the GC.  When I was
debugging, I noticed all the oci handle classes had disposed set to true --
this was before the finalizers on OracleConnection or OciGlue were called by
the GC.  So when OciGlue tried to Disconnect, it had already been disconnected.
 Or if you tried to create a statement handle to execute a query, it failed
because the environment handle needed to create the statement handle was
disposed.

I do not think these connections can be put back into the pool because the
handles were freed.  

Connection Pooling in Oracle Client (and ODBC too).
http://msdn.microsoft.com/en-us/library/ms254502.aspx

SQL Server connection pooling
http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx

OciGlue should notice that the handles were disposed and mark itself as invalid
somehow.  And have itself removed from the connection pool.  I suppose when
GetConnection is called, it can check to see if the connection it gets has not
had its environment handle disposed.

Take a look at TdsConnectionPool in Mono.Data.Tds which is the connection
pooling used by System.Data.SqlClient in Mono.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list