The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Oracle: "Object reference not set to an instance of an object" exception on LoadAll

Last post 08-03-2007, 12:07 PM by femi A. 4 replies.
Sort Posts: Previous Next
  •  08-03-2007, 8:11 AM 4275

    Oracle: "Object reference not set to an instance of an object" exception on LoadAll

    I keep getting an error when trying to Load via a stored proc. I am using Oracle 9i with ES 2007. The exception message and call stack are below. My config settings are also below. I generated without the schema and catalog info because the stored procs had the catalog name on them when generated by MyGeneration. When that did not work I regenerated the code with schema and catalog info which I am just about to test. Can anyone tell me if I am going in the right direction? I have used SQL server with ES for one year and noticed there is no "Initial Catalog" setting in the Oracle config unlike with SQLServer.

    public static TblXYzCollection GetDockets()

    {

    TblXYzCollection coll = new TblXYzCollection ();

    coll .LoadAll();

    return coll;

    }

    Exception Message: Object reference not set to an instance of an object.

    Stack trace:
      at EntitySpaces.Interfaces.esDataProvider.esLoadDataTable(esDataRequest request, esProviderSignature sig)
       at EntitySpaces.Core.esEntityCollection.Load(esQueryType queryType, String query, esParameters parms)
       at EntitySpaces.Core.esEntityCollection.Load(esQueryType queryType, String query)
       at EntitySpaces.Core.esEntityCollection.LoadAll()
       at PRC.Web.Data.TblXYZ.Load(DocketType dktType) in C:\Documents and Settings\.......\Custom\TblXYZ.cs:line 38

    <connectionInfo default="DevOracleDB"><connections>

    <add name="PRC_EntitySpaces_DevOracleDB" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL"

    provider="EntitySpaces.OracleClientProvider" providerClass="DataProvider"

    connectionString="Persist Security Info=True;User ID=XYZ;Password=XYZ;Data Source=XYZ.GOV;" />

    </connections></connectionInfo>

  •  08-03-2007, 8:58 AM 4278 in reply to 4275

    Re: Oracle: "Object reference not set to an instance of an object" exception on LoadAll

    Are you sure this is a stored proc problem? The default in your config is this:

    sqlAccessType="DynamicSQL"

    And, I do not see you overriding that in your code. To use our generated stored procedures for Oracle, it is best to leave Ignore Schema and Catalog at their default (unchecked), but the sqlAccessType should be "StoredProcedure".

    The name of the default connection must one of the named connections.

    connectionInfo default="DevOracleDB"

    add name="PRC_EntitySpaces_DevOracleDB"


    David Neal Parsons
    www.entityspaces.net
  •  08-03-2007, 10:33 AM 4282 in reply to 4278

    Re: Oracle: "Object reference not set to an instance of an object" exception on LoadAll

    I tested the dynamic queries as well but I have corrected my config for stored procs. I am getting the exception on both dynamic queries and stored procs.

    <EntitySpaces>

    <connectionInfo default="PRC_EntitySpaces_DevOracleDB">

    <connections>

    <add name="PRC_EntitySpaces_DevOracleDB" providerMetadataKey="esDefault" sqlAccessType="StoredProcedure"

    provider="EntitySpaces.OracleClientProvider" providerClass="DataProvider"

    connectionString="Persist Security Info=True;User ID=XYZ;Password=XYZ;Data Source=XYZ.GOV;" />

    </connections></connectionInfo></EntitySpaces>

  •  08-03-2007, 10:42 AM 4283 in reply to 4282

    Re: Oracle: "Object reference not set to an instance of an object" exception on LoadAll

    Have you assigned a loader in your in your Main() for winform or Global.asax for webform?

     

    Code:
    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
    
    using EntitySpaces.Interfaces;
    
    namespace EntitySpacesDemo
    {
    	static class Program
    	{
    		/// <summary>
    		/// The main entry point for the application.
    		/// </summary>
    		[STAThread]
    		static void Main()
    		{
                esProviderFactory.Factory = new EntitySpaces.LoaderMT.esDataProviderFactory();
    
    			Application.EnableVisualStyles();
    			Application.SetCompatibleTextRenderingDefault(false);
    			Application.Run(new Demo());
    		}
    	}
    }
     
    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  08-03-2007, 12:07 PM 4287 in reply to 4283

    Re: Oracle: "Object reference not set to an instance of an object" exception on LoadAll

    Excellent. Missed step. Thanks. My Global.asax now has:

    void Application_Start(object sender, EventArgs e)

    {

    EntitySpaces.Interfaces.esProviderFactory.Factory =

    new EntitySpaces.LoaderMT.esDataProviderFactory();

    }

View as RSS news feed in XML