Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexey Badyl 33 posts 205 karma points
    Jun 12, 2014 @ 10:31
    Alexey Badyl
    0

    There is already an open DataReader associated with this Command which must be closed first

    Hi, After update from 2.1.3 to 2.3 we see a lot of error in log file which connected to not closed Data Reader?

     

    Any idea how to fix it?

    System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.

       at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)

       at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)

       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

     

       at TeaCommerce.Api.Persistence.Database.Execute(Sql Sql)

     

       at TeaCommerce.Api.Persistence.Database.Update(String tableName, String primaryKeyName, Object poco, Object primaryKeyValue, IEnumerable`1 columns)

       at TeaCommerce.Api.Persistence.Database.Update(String tableName, String primaryKeyName, Object poco, IEnumerable`1 columns)

       at TeaCommerce.Api.Persistence.Database.Update(String tableName, String primaryKeyName, Object poco)

       at TeaCommerce.Api.Persistence.Repositories.StoreRepository.Save(Store store)

       at TeaCommerce.Api.Models.Store.Save()

       at TeaCommerce.Api.Models.Store.GetNextOrderNumber(Boolean onlyFinalizedOrders)

      at TeaCommerce.Api.Models.Order.Save()  

    at TeaCommerce.Api.Web.TeaCommerceHelper.GetCurrentOrder(Int64 storeId, Boolean autoCreate)

     

     

    Example 2

     

    2014-06-12 09:28:55,963 [10] ERROR System.String - [Thread 32] There is already an open DataReader associated with this Command which must be closed first.

    System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.

       at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)

       at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()

       at TeaCommerce.Api.Persistence.Database.<Query>d__c`1.MoveNext()

       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)

       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

       at TeaCommerce.Api.Persistence.Repositories.OrderRepository.GetInternal(Int64 storeId, String andQuery)

       at TeaCommerce.Api.Persistence.Repositories.OrderRepository.Get(Int64 storeId, Guid orderId)

       at TeaCommerce.Api.Models.Order.Save()

  • Anders Burla 2560 posts 8256 karma points
    Jun 12, 2014 @ 11:46
    Anders Burla
    0

    Hmm sounds weird as the persistence hasent changed in those versions. Could you try and restart the iis site? Does it happen all the time or just in edge cases?

    What DB do you use?

  • Alexey Badyl 33 posts 205 karma points
    Jun 13, 2014 @ 14:41
    Alexey Badyl
    0

    It is happen very often. On acceptance and produciton servers. Reset of iis didn't help us.  We even rollback changes from production because of it.

     

    We use MS SQL 2012.

  • Anders Burla 2560 posts 8256 karma points
    Jun 16, 2014 @ 11:48
    Anders Burla
    100

    Think i have it fixed. Could you email us at info (at) teacommerce.net and we can send you a nightly to test. Thanks

  • Alexey Badyl 33 posts 205 karma points
    Jun 19, 2014 @ 14:30
    Alexey Badyl
    0

    Hi, looks like issue was fixed in build you send to me. There no any such errors in our log file. When it can be released? Will it be build 2.3.2?

  • Anders Burla 2560 posts 8256 karma points
    Jun 23, 2014 @ 08:22
    Anders Burla
    0

    Yes it will be build 2.3.2. Dont have an exact date for release yet :)

  • Laurence Gillian 600 posts 1219 karma points
    Aug 28, 2014 @ 14:49
    Laurence Gillian
    0

    I can confirm the 2.3.2 resolves the issue with the database connection not being terminated when an error occurs.

    I assume this should be applied to any TeaCommerce installs? Cheers, Laurence

  • Anders Burla 2560 posts 8256 karma points
    Aug 28, 2014 @ 14:51
    Anders Burla
    0

    Yes that would be a good idea. So update all to 2.3.2

Please Sign in or register to post replies

Write your reply to:

Draft