[Mono-bugs] [Bug 52288][Maj] New - OracleClient brings exception " ORA-01000: maximum open cursors exceeded" when executing large number of statements

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 9 Jan 2004 06:52:43 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by joergr@voelcker.com.

http://bugzilla.ximian.com/show_bug.cgi?id=52288

--- shadow/52288	2004-01-09 06:52:43.000000000 -0500
+++ shadow/52288.tmp.6706	2004-01-09 06:52:43.000000000 -0500
@@ -0,0 +1,102 @@
+Bug#: 52288
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Suse 8.2
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Major
+Component: System.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: JoergR@voelcker.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: OracleClient brings exception " ORA-01000: maximum open cursors exceeded" when executing large number of statements
+
+Description of Problem:
+If you execute a large number of statements using System.Data.OracleClient
+you get the Oracle exception "ORA-01000: maximum open cursors exceeded".
+
+Steps to reproduce the problem:
+1. Set connection string in attached sample
+2. Compile
+3. Run
+
+Actual Results:
+Exception caught: System.Data.OracleClient.OracleException: ORA-01000:
+maximum open cursors exceeded
+
+in [0x00097] (at
+/home/viadmin/mono/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciStatementHandle.cs:191)
+System.Data.OracleClient.Oci.OciStatementHandle:Execute (bool)
+in [0x00002] (at
+/home/viadmin/mono/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciStatementHandle.cs:155)
+System.Data.OracleClient.Oci.OciStatementHandle:ExecuteQuery ()
+in [0x00054] (at
+/home/viadmin/mono/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:281)
+System.Data.OracleClient.OracleCommand:ExecuteReader
+(System.Data.CommandBehavior)
+in <0x00054> (wrapper remoting-invoke-with-check)
+System.Data.OracleClient.OracleCommand:ExecuteReader
+(System.Data.CommandBehavior)
+in [0x00002] (at
+/home/viadmin/mono/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:262)
+System.Data.OracleClient.OracleCommand:ExecuteReader ()
+in <0x00050> (wrapper remoting-invoke-with-check)
+System.Data.OracleClient.OracleCommand:ExecuteReader ()
+in [0x00001] (at
+/home/viadmin/mono/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs:330)
+System.Data.OracleClient.OracleCommand:System.Data.IDbCommand.ExecuteReader ()
+in [0x0007d] (at /home/viadmin/OracleCursorsExceeded.cs:39)
+Bug.MainClass:Main (string[])
+
+
+Expected Results:
+No error.
+
+How often does this happen? 
+When the number of open cursors reaches the configured maximum value of the
+oracle server (300 in our case).
+
+Additional Information:
+The reason for this behaviour is that OciHandles aren't disposed where they
+are created. They are disposed by the Finalizer. You can see this when you
+run the sample with option -gc. Then the garbage collector is triggered
+after 100 statements and the error disappears.
+
+------- Additional Comments From JoergR@voelcker.com  2003-12-17 08:32 -------
+Created an attachment (id=6267)
+Test case
+
+
+------- Additional Comments From JoergR@voelcker.com  2003-12-17 10:31 -------
+Created an attachment (id=6270)
+Proposed patch (still has a problem)
+
+
+------- Additional Comments From JoergR@voelcker.com  2003-12-17 10:44 -------
+The patch works fine with the attached test case.
+
+In our real world app it leads to the following problem after some time:
+ORA-21500: internal error code, arguments: [ttcdrv-recursivecall], [],
+[], [], [], [], [], [] in OCIStmtExecute
+
+I will try research this.
+
+------- Additional Comments From JoergR@voelcker.com  2003-12-18 08:58 -------
+Created an attachment (id=6274)
+Updated patch
+
+
+------- Additional Comments From JoergR@voelcker.com  2003-12-18 09:13 -------
+Cleaned up the patch a little bit.
+The crashes are maybe caused by multithreading problems (libcntsh.so
+is linked against libpthreads.so without GC support).
+
+------- Additional Comments From JoergR@voelcker.com  2004-01-09 06:52 -------
+Created an attachment (id=6371)
+Working patch. Fixes this and some other problems
+