ORA-01031 When Executing Dataset and Using Microsoft.Practices.EnterpriseLibrary.Data RRS feed

  • Question

  • User-1502422837 posted

    I'm currently getting this error -- see subject -- when attempting to execute a package in an Oracle database.  Below is the following code:

    Imports Microsoft.Practices.EnterpriseLibrary.Data.Oracle
    Imports System.Data.Common
    Imports Microsoft.Practices.EnterpriseLibrary.Data

    Public Class Form1

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim dbConnection As String = "DATA SOURCE=xxxxx;USER ID=xxxxx;PASSWORD=xxxxxx;PERSIST SECURITY INFO=TRUE;POOLING=FALSE"
            Dim odb As OracleDatabase = Nothing
            Dim ds As New DataSet

                OpenDatabase(odb, dbConnection)
                         odb.ExecuteNonQuery(CommandType.Text, "SET ROLE XXXXXX IDENTIFIED BY XXXXX")
                ds = odb.ExecuteDataSet("SOME_PACKAGE", 419, DBNull.Value)
                          Catch ex As Exception
                If Not d Is Nothing Then
                End If

            End Try

            End Sub

            Private Sub OpenDatabase(ByRef odb As OracleDatabase, ByVal dbConnection As String)
            odb = New OracleDatabase(dbConnection)
        End Sub

    End Class

    The connection is successful.  The 'Set Role' is successful.  But when I try to execute the dataset, I get "Insufficient Privileges" error.  This code worked a while back, and I can't figure out why it doesn't work now.  I've set the role, and the role has execute privileges on this package.  I've tested it in SQL+ with no problems.

    Has anyone come across a similar problem when using Microsoft.Practices.EnterpriseLibrary.Data.Oracle?



    Tuesday, April 14, 2009 10:59 AM

All replies

  • User-1502422837 posted

    OK, apparently only Oracle servers that have the Oracle patch are affected by this.

    A solution -- although I'm not sure this is the best solution -- is to remove the "POOLING=FALSE" from the connection string.

    Wednesday, April 15, 2009 8:48 AM