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

2011-08-15 Thread bugzilla_noreply

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

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


--- Comment #22 from Daniel Morgan  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.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-15 Thread bugzilla_noreply

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

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


--- Comment #21 from Dan McFadyen  2011-08-15 15:20:09 UTC 
---
Created an attachment (id=445821)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445821)
OracleConnection.cs and OracleConnectionPool.cs


I've read over the files and read some comments from Chris Brown, and there
were a couple things pointed out.

Pointed out by Chris Brown:
 - OracleConnectionPool.cs
   - I think the 'lock (list)' that you have added around the adding and
removing to the list in GetConnection is redundant. The very first level of
braces in that function a lock on the same object.
   - At line 86:  if (connection == null && list.Count < PoolMaxSize)
 - From the previous code, the intent of this statement is to prevent
creating more connections than the maximum pool size. The problem is that the
list here doesn't maintain references to all the OciGlue objects, just the
unused ones. If every OciGlue class is currently in used, then list.Count will
always be zero. This means that there is no maximum pool size any more. The int
activeConnections you removed was a count of all connections, including the
ones not currently in the pool.
   - I can't see any references to the bool disposed.

Now, there is a lot of good stuff. The OciGlue looks like it will be cleaned up
correctly and properly disposed of now. Aside from the connection pool issue
above, the original issue seems solved. But there is something I noticed with
even my bad attempt at a fix.

The code wasn't broken for trying to add the OciGlue back into the connection
pool. It was broken for trying to add a OciGlue object that had been disposed
back into the pool. This only happens because when the GC goes after the
connection, the OciGlue is only referenced by the connection, and because of
that it goes down with it. If we keep a reference to the OciGlue outside of the
connection, and in the pool, then when the connection gets GC'd it will instead
add a valid OciGlue reference back into the pool. This would keep the intent of
the code (and pooling) intact, so leaked connections are still correctly
pooled.

If a second list was added to the connection pool, one that maintained a list
of all OciGlue objects it ever made, it could be used to fix the issue at line
86, as it would be a valid test against the maximum pool size, and it would
also keep the OciGlue objects alive while the connection objects are destroyed.
This in turn means that the original logic in the OracleConnection class can be
left alone as even if the GC is doing the disposing, what it's doing will be
correct.

The attachment contains copies of your files modified to this end as an
example.

Also, I noticed you fixed up the bug you'd get if you called Close more than
once. Thanks.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445741|0   |1
is obsolete||

--- Comment #20 from Daniel Morgan  2011-08-15 06:19:24 
UTC ---
Created an attachment (id=445761)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445761)
OralceClientPoolingFix2.zip

updated fix for the 4 csharp files

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #19 from Daniel Morgan  2011-08-15 06:17:02 
UTC ---
The GC was releasing the unmanaged resources before the managed resources had a
chance to release them via disconnect.  As far as I know, there is no
guaranteed order in which the GC will release resources which is why it is best
to be explicit via a Close or Dispose.  

Additional, OracleConnectionPoolManager should not have a Finalize method.

When disconnecting in OciGlue, make sure not only the various handles are not
null, but also the internal unmanaged Handle is not IntPtr.Zero.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445740|0   |1
is obsolete||

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445736|1   |0
is obsolete||

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445739|0   |1
is obsolete||

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445738|0   |1
is obsolete||

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445737|0   |1
is obsolete||

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 Attachment #445736|0   |1
is obsolete||

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #18 from Daniel Morgan  2011-08-15 00:28:52 
UTC ---
Created an attachment (id=445741)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445741)
OracleClientPoolingFix.zip - 4 .cs files

Patch is a zip file that contains 4 C# files to fix the connection pooling
errors if a programmer did not explicit call Close, Dispose, nor use it in a
using statement.

The four files:
OracleConnection.cs
OracleConnectionPool.cs
OracleConnectionPoolManager.cs
OciGlue.cs

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #17 from Daniel Morgan  2011-08-15 00:08:28 
UTC ---
Created an attachment (id=445740)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445740)
proposed OciGlue.cs - see Disconnect

See Disconnect and finalize method ~OciGlue
Since there a unmanaged resources, a finalize method should be implemented
which calls Disconnect.  Disconnect should not disconnect if not opened.  When
disconnected, make sure the status is changed to disconnected.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #16 from Daniel Morgan  2011-08-15 00:05:31 
UTC ---
Created an attachment (id=445739)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445739)
proposed OracleConnectionPoolManager.cs

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #15 from Daniel Morgan  2011-08-15 00:04:20 
UTC ---
Created an attachment (id=445738)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445738)
proposed OracleConnectionPool.cs - see Dispose

make sure collection that is private to the class is locked when adding or
removing items.  See Dispose.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #14 from Daniel Morgan  2011-08-15 00:02:55 
UTC ---
Created an attachment (id=445737)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445737)
proposed OracleConnection.cs - see Dispose method

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


--- Comment #13 from Daniel Morgan  2011-08-14 23:51:12 
UTC ---
Created an attachment (id=445736)
 --> (http://bugzilla.novell.com/attachment.cgi?id=445736)
OracleClientTests.cs - Test for this bug

This test I was able to reproduce problem with connection pooling and the user
did not explicitly Close nor Dispose nor use a using statement.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-14 Thread bugzilla_noreply

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

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


Daniel Morgan  changed:

   What|Removed |Added

 CC||monodanm...@yahoo.com

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-11 Thread bugzilla_noreply

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

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


--- Comment #12 from Dan McFadyen  2011-08-11 12:26:59 UTC 
---
I was just awoken to a fact by Chris Brown.

My fix doesn't work if you explicitly call the Dispose function, only if the GC
is doing it.

Something more intelligent needs to be done than what I suggested sadly.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-10 Thread bugzilla_noreply

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

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


--- Comment #11 from Dan McFadyen  2011-08-10 15:37:32 UTC 
---
I figured out the issue.

When using connection pooling, any OracleConnection object that gets leaked
without being closed will cause a problem.

The problem being is that because there are no references to the
OracleConnection object any more, the GC will do it's job and dispose the
object. The OracleConnection.Dispose function calls close. Any connection that
gets close called on it while it's part of connection pooling will re-add
itself to the connection pool.

Because there are still references to the pool from other static members, it's
still a valid object. So the dispose function happily re-adds a disposed
connection object back into the pool, then cleans itself up.

The connection is then sitting in the pool as a ticking time bomb for the next
time it's used.

I have no idea what the effects of having references to a GC disposed object
around are, but they can't be good. Even worse, I figured out that the parenth
IntPtr that was null from my last comment, is actually a 'this' reference that
is null.

The only fix I can see is in the OracleConnection.cs file, in the Dispose
function, just before you call Close, set pooling to false, and pool = null.


[MonoTODO]
protected override void Dispose (bool disposing)
{
if (!disposed) {
->pooling = false;
->pool = null;
if (State == ConnectionState.Open)
Close ();
dataReader = null;
transaction = null;
oci = null;
pool = null;
conInfo.Username = string.Empty;
conInfo.Database = string.Empty;
conInfo.Password = string.Empty;
connectionString = null;
parsedConnectionString = null;
base.Dispose (disposing);
disposed = true;
}
}


Obvious downside here is that any connection you leak won't go back to the pool
and you lose the speed benefit of it. But the only way you could keep the
dispose from being called would be to keep references to it somewhere, which
then you'd have no way of knowing if the connections are leaked.

A bit of performance seems a fair price to pay if connections are being leaked
as it's a bad thing to do. But avoiding a crash is probably much nicer.

I hope that even if you can't reproduce the bug, the description of the
behavior should be enough to get this fixed.

Thanks,

Dan

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-08 Thread bugzilla_noreply

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

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


--- Comment #10 from Dan McFadyen  2011-08-08 15:02:16 UTC 
---
Thanks for the information Jean-Philippe. I have just been informed that the
amount of time I have to keeping looking into this now has a hard deadline so I
might be making use of it. But in the mean time I hope to help as much as I
can.

I have reduced the test case to something that reproduces it for me with no
proprietary code. I have been in contact with Chris Brown from the posts above
and sadly the same test does not reproduce it on his system. There is hope
though. My environment is the currently available Mono openSUSE VM.

Note: The code that I use to reproduce this bug explicitly leaks connections.
Yes, I am aware that this shouldn't be done, but this isn't the only way to
reproduce the bug as from my conversations with Chris we have confirmed a case
where it happens without leaking connections, and I can leak connections
without hitting the problem. In this case it's just the first easy way I found
to reproduce the bug.

Details:
 - OS: openSUSE VM with mono 2.10.2
 - Mono exact: 2.10.2 (Mon Apr 18 15:10:34 UTC 2011) x86
 - Oracle Instant Client: 11.2-basiclite

For reference, testing against Oracle 11G 11.1.7.0 on another server.


---Contents of aspx file start

<%@ Import namespace="System.Data.OracleClient" %>
<%
try
{   
 OracleConnection conn = new OracleConnection("Data Source=O11G;User
ID=;Password= ");
 conn.Open();
 {
   using (OracleCommand cmd = conn.CreateCommand())
   {
cmd.CommandText = "SELECT 1 FROM dual";
cmd.ExecuteScalar();
cmd.CommandText = "SELECT 2 FROM dual";
cmd.ExecuteScalar();
   }
 }
 //conn.Close();
}
catch (Exception ex)
{
 %><%=ex.Message + Environment.NewLine + ex.StackTrace%><%
}
%>

-Contents End---

And in the Web.config under
 
Add


It will take 5 refreshes to that page to get the error reproduced, but it's
been a consistent 5 times for me.

After talking with Chris Brown a few more times he pointed me to the trace
messages in System.Data.OracleClient.Oci.OciCalls.cs. I took advantage of this
and modified the OCIHandleAlloc call so that it printed out information about
all the parameters provided. The error is caused because the IntPtr parenth is
null.

If more information is required or the test case I have provided doesn't work
on a system you have available, I can remove all of our code from the VM and
package it up so that you can have the exact environment I was using to
reproduce it.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-02 Thread bugzilla_noreply

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

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


--- Comment #9 from Jean-Philippe Gouigoux  2011-08-02 
22:14:17 UTC ---
Just for information : a few months after opening this bug, I have had a
discussion with the former maintainer for this part of Mono, and he made it
quite clear Novell is not going to spend much time getting everything sorted
for the use of Oracle in Mono.

I have switched to a commercial provider for Oracle that works quite well, and
I think I did well, since this bug is still there a few years after its
opening. Honestly, I can only recommend doing the same.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-02 Thread bugzilla_noreply

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

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


--- Comment #8 from Chris Brown  2011-08-02 21:55:48 
UTC ---
Thanks for your response Dan. Yes I do think you have something unique in
relation to this particularly as this issue seems to have been around for
nearly 3 years. 

Without going into any details about your proprietary code can you give any
specifics about the 100% reproducible case? I might then be able to see how
this could relate to the error occurring in my application. 

Also can you give any further details about your test case- presumably you have
narrowed down the area responsible for the issue to some degree? I will start
putting one together myself and then perhaps between the two of us we can
produce a test case which will reliably fail. 

This issue is amajor problem for us at the moment so I'm devoting alot of time
to it. If there is any additional information I can provide you then let me
know also. Thanks.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-02 Thread bugzilla_noreply

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

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


Dan McFadyen  changed:

   What|Removed |Added

 CC||d...@cryptocard.com

--- Comment #7 from Dan McFadyen  2011-08-02 19:17:05 UTC 
---
I've run into the same issue with up to 2.10 at the moment but it would seem
that I have something unique at the moment.

I have a 100% reproducible use case that I can get to happen after I restart
Apache and it happens at the same spot 5-6 clicks deep into the application.

Given that I can do that I have started working on a way to get it to do the
exact same thing without any of our proprietary code in it so I can submit it
as a test case. Sadly the test case hasn't failed yet, but I'm still working on
it.

So in the mean time, is there any information I can get off my machine that may
be helpful?

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-08-01 Thread bugzilla_noreply

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

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


Chris Brown  changed:

   What|Removed |Added

 CC||chrisbrow...@hotmail.com

--- Comment #6 from Chris Brown  2011-08-02 01:21:53 
UTC ---
I am running a web application on openSUSE 11.1 with Mono 2.11 and I am also
experiencing this error intermittently ("Could not allocate new OCI Handle of
type Statement"). I'm using Oracle XE 10g.

As previously stated it is very hard to produce a test case and the error does
not seem to be tied to any particular part of my code. For example I have seen
this issue appear during the databinding of a web control via an
ObjectDataSource and TableAdapter. I've also experienced it calling a method on
a TableAdapter directly in my session provider. When the error occurs
restarting Apache is the only option.

I have a Windows Service also running on the same system under Mono accessing
the same database and the error has never shown in this. I have read that there
may be threading issues accessing Oracle with Mono and I'm not sure if this
could be related (or perhaps multiple connections)?

Did anyone make any progress narrowing down the cause of this problem or find
any sort of workaround? Otherwise is there anyway I can capture some extra
logging information for when the error next occurs and possibly ultimately put
together a test case?

Thanks

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-01-13 Thread bugzilla_noreply

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

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


--- Comment #5 from Jonathan Vargas  2011-01-13 19:56:15 UTC 
---
Sometimes this message appears in apache's error log, when mono crashes :


Native stacktrace:

/opt/novell/mono/bin/mono.bin [0x48a6e9]
/opt/novell/mono/bin/mono.bin [0x4d621d]
/lib64/libpthread.so.0 [0x3992e0e4c0]
/lib64/libpthread.so.0(pthread_mutex_lock+0x13) [0x3992e08293]
/usr/lib/oracle/11.2/client64/lib/libclntsh.so(sltsmna+0xd)
[0x3b55a1376f]
/usr/lib/oracle/11.2/client64/lib/libclntsh.so(kpufhndl0+0x240)
[0x3b53eaeace]
/usr/lib/oracle/11.2/client64/lib/libclntsh.so(kpufhndl+0xb)
[0x3b53eae889]
/usr/lib/oracle/11.2/client64/lib/libclntsh.so(OCIHandleFree+0x13)
[0x3b53e7aa15]
[0x41921dc1]

Debug info from gdb:


=
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=

[Thu Jan 13 13:42:48 2011] [error] (70014)End of file found: read_data failed
[Thu Jan 13 13:42:48 2011] [error] Command stream corrupted, last command was 1

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2011-01-13 Thread bugzilla_noreply

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

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


Jonathan Vargas  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW
 CC||jvar...@alkaid.cr
   InfoProvider|jp.gouig...@free.fr |

--- Comment #4 from Jonathan Vargas  2011-01-13 18:59:12 UTC 
---
Hi, we also have this problem and I will explain why a test case is difficult
to submit and study is necessary.

Our environment:
--
We have an asp.net app running on mono 2.67 on redhat enterprise 5 and apache
2.2.3 on a 64 bit host.

We have tried to connects to Oracle Database through Oracle Instant Client and
the Oracle's 11g Client, for 64 bits, both to an Oracle XE and a Oracle
Database Standar, on separate hosts.


The problem:
--
The apps works fine, but very often in some queries we get the error described
at this line of code in OracleClient's code: 

https://github.com/mono/mono/blob/master/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciHandle.cs#L88

"Could not allocate new OCI Handle of type {0}"

The error is triggered sometimes with a handler of type "OciSentenceHandle", or
"OciTransactionHandle", and in the worst case, mod-mono-server just crashes and
we get the following error in apache's log:


Stacktrace:

Native stacktrace:

[Thu Jan 13 11:47:15 2011] [error] (70014)End of file found: read_data failed
[Thu Jan 13 11:47:15 2011] [error] Command stream corrupted, last command was 1


No solution
--
We haven't found any trick or idea of what's going on, as we are not experts in
OCI's code and operation. After we receive this exception, the previously
stablished connection seems to be dirty or something, because we try to
retrieve schema information for a table and it returns invalid info.


Expectation
--
Determine what are the cases when this call returns unexpected values: 

OCIHandleAlloc (this,
  out newHandle,
  type,
  0,
  IntPtr.Zero
);

And then search for a solution. Also, it the problem is definitively at
oracle's side, or if it should be managed by mono's OracleClient
implementation.

If you need more information please ask us for it. Thanks in advance.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2009-11-02 Thread bugzilla_noreply
http://bugzilla.novell.com/show_bug.cgi?id=421491

User jp.gouig...@free.fr added comment
http://bugzilla.novell.com/show_bug.cgi?id=421491#c3





--- Comment #3 from Jean-Philippe Gouigoux   2009-11-02 
01:10:04 MST ---
(In reply to comment #2)
> Is it possible for you to attach a self-contained test case?

Quite difficult as there is a lot of code, and there is no particular case
where it fails. In fact, any sample code with write/read operations will fail
under load. I insist on that : no problem is seen as long as only one user
connects to the web services. But when the load begins, the OCI-Handle error
appears from time to time.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2009-10-29 Thread bugzilla_noreply
http://bugzilla.novell.com/show_bug.cgi?id=421491

User vvarad...@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=421491#c2


Veerapuram Varadhan  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO
 CC||vvarad...@novell.com
  Info Provider||jp.gouig...@free.fr
 AssignedTo|bnc-blr-team-m...@forge.pro |vvarad...@novell.com
   |vo.novell.com   |




--- Comment #2 from Veerapuram Varadhan   2009-10-29 
12:04:46 MDT ---
Is it possible for you to attach a self-contained test case?

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs


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

2009-05-05 Thread bugzilla_noreply
http://bugzilla.novell.com/show_bug.cgi?id=421491

User skol...@gmail.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=421491#c1


Leszek Ciesielski  changed:

   What|Removed |Added

Version|1.9 |2.4.x




--- Comment #1 from Leszek Ciesielski   2009-05-05 03:35:25 
MDT ---
Cipra Martin wrote: The problem persists across all mono versions (1.9, 2.0,
2.2, 2.4)

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug.
___
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs