Failed in called stored procedure

6 posts, 0 answers
  1. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 01 Jul 2011 Link to this post

    Hi,

    I have upgraded my OA ORM to latest version "2011.1.411.2". The application compiles fine but when running it fails resulting following stack trace -

    at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) at Telerik.OpenAccess.RT.ExceptionWrapper.Throw() at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount) at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getNextQueryResult(QueryResultWrapper aQrs, Int32 skipAmount) at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize(Int32 indexParam) at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam) at Telerik.OpenAccess.RT.ListEnumerator.setCurrent(Int32 _pos) at Telerik.OpenAccess.RT.ListEnumerator.Move(Int32 relative) at Telerik.OpenAccess.RT.ListEnumerator.MoveNext() at Telerik.OpenAccess.RT.QueryResultImpl.ToList() at Telerik.OpenAccess.RT.ObjectScope.ExecuteStoredProcedure[T](String procedureName, IEnumerable`1 parameterDefinition, Object[] parameterValues) at Telerik.OpenAccess.OpenAccessContextBase.ExecuteStoredProcedure[T](String procedureName, IEnumerable`1 parameterDefinition, Object[] parameterValues) at APForensicsDataRepository.APForensicsDbContext.DPFRptVendorAnalysis(String reportNameIDs, Nullable`1 dateFrom, Nullable`1 dateTo, Nullable`1 invDateOrEnteredDate, Nullable`1 sECOrganisationID, Nullable`1 returnRecords, String sortBy) in D:\APForensics\trunk\APForensicsDataRepository\EntityDiagrams.cs:line 2339 at APForensicsDataRepository.InvoiceAnalysis.ManagementInfoReportRepository.GetVendorAnalysisRecords(Nullable`1 orgID, String reportNameIDs, Char invDateOrEnteredDate, Nullable`1 dateFrom, Nullable`1 dateTo, String sortBy, Int32 returnRecords) in D:\APForensics\trunk\APForensicsDataRepository\InvoiceAnalysis\ManagementInfoReportRepository.cs:line 325 at IsisWebApp.WebUI.Reports.InvoiceAnalysis.frmSupplierAnalysisReport.btnDisplayReport_Click(Object sender, EventArgs e) in D:\APForensics\trunk\APForensicsWebApp\WebUI\Reports\InvoiceAnalysis\frmSupplierAnalysisReport.aspx.cs:line 354


    Could you please let me know why it is failing when the old version was working fiine? The new thing I noticed is that stored procedure parameter of type NVARCHAR(1) is converted to persistent class Char.


    Many thanks.

    MG


  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 07 Jul 2011 Link to this post

    Hello Milan,

     Is there an inner exception available? Can you provide the call stack for that exception?
    Also can you provide the stored procedure defintion, in particular the type of each parameter of the stored procedure and the call to context.ExecuteStoredProcedure. This would help in narrowing down to the exact cause of the exception.

    Looking forward to resolving this issue.

    Kind regards,
    Ady
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 12 Jul 2011 Link to this post

    HI Ady,

    For the time being, I have changed to NVARCHAR(2) where there was problem. You could easily try at your end to generate persistent classes based on stored procedure taking parameter of data type nvarchar(1).

    E.g

    Create procedure spTest
        (
        @fName NVARCHAR(20),
        @middleName nvarchar(1)
        )
        as    
    BEGIN
        select * from myTable where firstname = @fName and middleName like '@middleName%'
     END

    Thx.
    MG
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 15 Jul 2011 Link to this post

    Hi Milan,

     I was able to reproduce the exception and we will fix this. Your Telerik points have been updated.

    All the best,
    Ady
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Ken
    Ken avatar
    1 posts
    Member since:
    Jun 2009

    Posted 08 Aug 2011 Link to this post

    I'm also having a stored procedure issue. My problem is a stored procedure runs for about 6 minutes, then throws an exception. I tried changing the ConnectionTimeout, but it still throws the exception. Here's my stack trace

    Query failed: System.InvalidOperationException: Invalid attempt to call VisibleFieldCount when reader is closed.
       at System.Data.SqlClient.SqlDataReader.get_VisibleFieldCount()
       at OpenAccessRuntime.Relational.query.RelationalCompiledQuery.CreateMappingInfo(ResultSet rs, ClassMetaData cmd, String filter, RelationalMappingResolver rmr)
       at OpenAccessRuntime.Relational.query.RelationalCompiledQuery.getMappingInfo(ResultSet rs)
       at OpenAccessRuntime.Relational.RelationalQueryResult.createFetchResult(Connection conParam, SqlDriver sqlDriver, Boolean scrollableParam, FetchSpec fetchSpec, RelationalCompiledQuery relationalCompiledQuery, RelationalStorageManager storageManager, QueryParameters parameters, Int32 fetchSize, Int32 maxRows)
       at OpenAccessRuntime.Relational.RelationalQueryResult.executeActual() System.InvalidOperationException: Invalid attempt to call VisibleFieldCount when reader is closed.
       at System.Data.SqlClient.SqlDataReader.get_VisibleFieldCount()
       at OpenAccessRuntime.Relational.query.RelationalCompiledQuery.CreateMappingInfo(ResultSet rs, ClassMetaData cmd, String filter, RelationalMappingResolver rmr)
       at OpenAccessRuntime.Relational.query.RelationalCompiledQuery.getMappingInfo(ResultSet rs)
       at OpenAccessRuntime.Relational.RelationalQueryResult.createFetchResult(Connection conParam, SqlDriver sqlDriver, Boolean scrollableParam, FetchSpec fetchSpec, RelationalCompiledQuery relationalCompiledQuery, RelationalStorageManager storageManager, QueryParameters parameters, Int32 fetchSize, Int32 maxRows)
       at OpenAccessRuntime.Relational.RelationalQueryResult.executeActual()
  7. Ady
    Admin
    Ady avatar
    588 posts

    Posted 11 Aug 2011 Link to this post

    Hi Ken,

    Is this exception consistently reproducible or does it happen only sometimes? What is the value for the 'Active connection timeout' configuration property? Can you test executing the stored procedure by turning of the OpenAccess managed connection pool? You can do this by specifying the <mediumTrust>True</mediumTrust> entry in the app.config file, in the backendconfiguration section. You can also set it via the 'Backend configuration settings' dialog.


    Greetings,
    Ady
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top
DevCraft banner