Windows Oracle Data Access Components (MOSC)

MOSC Banner

CommandBuilder Cursor Leaks when using Factory Classes *HELP*

edited Nov 18, 2010 10:56PM in Windows Oracle Data Access Components (MOSC) 2 commentsAnswered
 Using the following code I get a ORA-01000: maximum open cursors exceeded.  As can be seen all of the disposable objects are disposed and therefore there shouldn’t be any leaks.

        Using conn As Oracle.DataAccess.Client.OracleConnection = New Oracle.DataAccess.Client.OracleConnection
            conn.ConnectionString = connectionString
            conn.Open()
            For i As Integer = 0 To 1000
                Using cmd As Oracle.DataAccess.Client.OracleCommand = conn.CreateCommand
                    cmd.Connection = conn
                    cmd.CommandText = "SELECT * FROM TESTER WHERE ID = " & i
                    Using da As Oracle.DataAccess.Client.OracleDataAdapter = New Oracle.DataAccess.Client.OracleDataAdapter
                        da.SelectCommand = cmd
                        Using cb As DbCommandBuilder = New Oracle.DataAccess.Client.OracleCommandBuilder
                            cb.DataAdapter = da

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center