Just reverting back to 7.5.13. Everything works as normal, I can use "AddOrUpdateOrderLine", with no errors from TC.
I think you might be able to get around this by setting "Multiple Active Result Sets" (MARS) - However on my particular Azure Database, I cant override this locally, and cant (currently) find a way to change this through the AZURE control panel.
Its pretty weird as Tea Commerce use its own instance of PetaPoco in the Core and not the one from Umbraco. So it might be because of the hosting environment??
You can see that we use the connection string from Umbraco but thats it. The Database class is PetaPoco that is a .cs file in the Tea Commerce core.
Message":"An error has occurred.","ExceptionMessage":"Invalid attempt to call Read when reader is closed.","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)\r\n at System.Data.SqlClient.SqlDataReader.Read()\r\n at umbraco.DataLayer.RecordsReaderAdapter1.Read()\r\n at TeaCommerce.Umbraco.Configuration.Compatibility.Domain.GetDomainsById(Int32 nodeId)\r\n at TeaCommerce.Umbraco.Configuration.Services.LanguageService.GetLanguageIdByNodePath(String nodePath)\r\n at TeaCommerce.Umbraco.Configuration.InformationExtractors.PublishedContentProductInformationExtractor.GetLanguageId(IPublishedContent product, VariantPublishedContent variant)\r\n at TeaCommerce.Umbraco.Configuration.InformationExtractors.PublishedContentProductInformationExtractor.GetSnapshot(String productIdentifier)\r\n at TeaCommerce.Api.Services.ProductService.GetSnapshot(String productIdentifier)\r\n at TeaCommerce.Api.Models.OrderLineCollection.AddOrUpdate(String productIdentifier, Nullable1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)\r\n at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderLine(Int64 storeId, String productIdentifier, Nullable1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)\r\n at in ..:line 20\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at
Just looked into your stack trace and it looks like it has something to do with the SqlHelper used in TeaCommerce.Umbraco.Configuration.Compatibility.Domain.GetDomainsById. That should properly use the DatabaseContext instead now that we only need to support Umbraco 7. Do you guys have a developer that have the time to look into that right now? The code is right here on GitHub and open source so you can change it.
Else - we at the core team need to have access to your hosting environment, your entire solution and instructions on how to replicate this bug on your setup. Then we can try and fix it and upload a new dll and see if that fixes the issue. We have not had this problem our self as we have own hosting.
Sorry about the problems - that is what happens when Umbraco upgrades its code :)
The problem is the same - the initial stater it the add or update order lines - but ends in the Domain code that I posted earlier today. So the problem is with the domain code and the SqlHelper used there from Umbraco.
You can ask Johan Sandström about the environment. I have tried all versions, using the form, javascript and using a backend controller. All fail on the database issue.
As far as I am concerned. This is the key to everything.
System.InvalidOperationException: Invalid attempt to call Read when reader is closed.
at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
at System.Data.SqlClient.SqlDataReader.Read()
at umbraco.DataLayer.RecordsReaderAdapter`1.Read()
When calling
TC.addOrUpdateOrderLine({storeId:1, productIdentifier:(anything), quantity:1});
from script or otherwise.
System.InvalidOperationException: Invalid attempt to call Read when reader is closed.
at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
at System.Data.SqlClient.SqlDataReader.Read()
at umbraco.DataLayer.RecordsReaderAdapter1.Read()
at TeaCommerce.Umbraco.Configuration.Compatibility.Domain.GetDomainsById(Int32 nodeId)
at TeaCommerce.Umbraco.Configuration.Services.LanguageService.GetLanguageIdByNodePath(String nodePath)
at TeaCommerce.Umbraco.Configuration.InformationExtractors.PublishedContentProductInformationExtractor.GetSnapshot(String productIdentifier)
at TeaCommerce.Api.Models.OrderLineCollection.AddOrUpdate(String productIdentifier, Nullable1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)
at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderLine(Int64 storeId, String productIdentifier, Nullable1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)
at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderLine(Int64 storeId, IDictionary2 formFields, IDictionary`2 settings)
at TeaCommerce.Api.Web.FormPostHandler.FormPost()
Just download and go to the build folder and run the release bat file. You just need VS so you have MS build. Then you will have a zip file to install or just overwrite the bin file.
Brill - thanks Anders, this has been an annoying show stopper for a while - so it'll be nice to get an official release for it. Us being paying licensee owners :-)
Database Error when using Umbraco 7.6.1 and TeaCommerce 3.2.2
Test Case 1
I seem to get an error when calling "AddOrUpdateOrderLine" - Looking at the error, it relates to the fact that the Database reader has already been closed. I think this might be related to https://our.umbraco.org/documentation/Getting-Started/Setup/Upgrading/760-breaking-changes and (U4-9201) specifically
Test Case 2
Just reverting back to 7.5.13. Everything works as normal, I can use "AddOrUpdateOrderLine", with no errors from TC.
I think you might be able to get around this by setting "Multiple Active Result Sets" (MARS) - However on my particular Azure Database, I cant override this locally, and cant (currently) find a way to change this through the AZURE control panel.
Might be because of Umbraco 7.6. Someone tried to update to 7.6.1 and it worked.
https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/issues/58
Kind regards
Anders
I'm running on 7.6.1 and had upgraded from 7.5.13 to 7.6.0 to 7.6.1 without any issues with 3.2.2
We have the same problem with 3.2.2 and 7.6.2. It either locks up the reader och when posting. The db is a SQLServer2016
Anything to be done here?
Btw, is there a way to force close the underlying db?
I believe 7.6.2/7.6.3 fixed a datareader issue, maybe that would correct your problem?
Its pretty weird as Tea Commerce use its own instance of PetaPoco in the Core and not the one from Umbraco. So it might be because of the hosting environment??
You can see that we use the connection string from Umbraco but thats it. The Database class is PetaPoco that is a .cs file in the Tea Commerce core.
https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/blob/master/Source/TeaCommerce.Umbraco.Configuration/Persistence/DatabaseFactory.cs
Kind regards
Anders
Agreed, it maybe due to the hosting environment, and how multiple connections to the DB are handled. (Windows Azure).
As Umbraco Cloud runs on "windows azure", I think it would be worthwhile checking that TeaCommerce 3.2.2 works on 7.6.2, on the Cloud.
@Anders, in your link, I notice we have this line
Which is the main connection string name used by Umbraco - maybe the issue is here??
I'm not ultra-techy I'm afraid - so I maybe I'm barking up the wrong tree :-)
Few gotchas.
-It is not Azure but a regular HostedVM that works for everything else. -I have used that MultipleResultSets but no go.
Anders: Any chance you could ask the Core team about this?
I will reinstall on a new 7.6.3 and see what happens
7.6.3 and this is what happens (still).
Message":"An error has occurred.","ExceptionMessage":"Invalid attempt to call Read when reader is closed.","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)\r\n at System.Data.SqlClient.SqlDataReader.Read()\r\n at umbraco.DataLayer.RecordsReaderAdapter
1.Read()\r\n at TeaCommerce.Umbraco.Configuration.Compatibility.Domain.GetDomainsById(Int32 nodeId)\r\n at TeaCommerce.Umbraco.Configuration.Services.LanguageService.GetLanguageIdByNodePath(String nodePath)\r\n at TeaCommerce.Umbraco.Configuration.InformationExtractors.PublishedContentProductInformationExtractor.GetLanguageId(IPublishedContent product, VariantPublishedContent variant)\r\n at TeaCommerce.Umbraco.Configuration.InformationExtractors.PublishedContentProductInformationExtractor.GetSnapshot(String productIdentifier)\r\n at TeaCommerce.Api.Services.ProductService.GetSnapshot(String productIdentifier)\r\n at TeaCommerce.Api.Models.OrderLineCollection.AddOrUpdate(String productIdentifier, Nullable
1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)\r\n at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderLine(Int64 storeId, String productIdentifier, Nullable
1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)\r\n at in ..:line 20\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary
2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n atThis last was an attempt with a WebApi call but it did not work as I had hoped.
Anders.
We just bought this license and we have a customer that is expecting to see some examples tomorrow. Any chance for a quick fix on the db-issue?
Hi Marcus
Just looked into your stack trace and it looks like it has something to do with the SqlHelper used in TeaCommerce.Umbraco.Configuration.Compatibility.Domain.GetDomainsById. That should properly use the DatabaseContext instead now that we only need to support Umbraco 7. Do you guys have a developer that have the time to look into that right now? The code is right here on GitHub and open source so you can change it.
https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/blob/dev/Source/TeaCommerce.Umbraco.Configuration/Compatibility/Domain.cs
Else - we at the core team need to have access to your hosting environment, your entire solution and instructions on how to replicate this bug on your setup. Then we can try and fix it and upload a new dll and see if that fixes the issue. We have not had this problem our self as we have own hosting.
Sorry about the problems - that is what happens when Umbraco upgrades its code :)
Kind regards
Anders
Should be added that the error is the same as the original poster. Except we use HostedVM and I have tried MARS without any luck.
Now on 7.6.3
The problem is the same - the initial stater it the add or update order lines - but ends in the Domain code that I posted earlier today. So the problem is with the domain code and the SqlHelper used there from Umbraco.
Hi Anders,
You can ask Johan Sandström about the environment. I have tried all versions, using the form, javascript and using a backend controller. All fail on the database issue.
I will download this and see if I can change it.
Not sure if this is related, but even the TeaCommerce demo site isnt working. (running on 7.6.2)
The issue only occurs on the Product Variant page...
https://demo.teacommerce.net/very-expensive-yachts/one-masted-yacht/
(try, Selecting a Colour and then a size - The size always remains greyed out, and you cant add to cart)
The "simple" product page, seems to be acting "OK"
https://demo.teacommerce.net/expensive-yachts/summer-yacht/
Over to you Anders :-)
Should be added that the online version seems to be different from the download version. If I understood that correctly from previous comments.
I have tried installing everything with 7.5.x and it seems to work also. Problems started with 7.6 apparently.
That has nothing to do with the database problem - seems like another problem.
As far as I am concerned. This is the key to everything.
System.InvalidOperationException: Invalid attempt to call Read when reader is closed. at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) at System.Data.SqlClient.SqlDataReader.Read() at umbraco.DataLayer.RecordsReaderAdapter`1.Read()
When calling TC.addOrUpdateOrderLine({storeId:1, productIdentifier:(anything), quantity:1}); from script or otherwise.
This is a default formpost
2017-06-06 13:36:54,953 [P4848/D7/T50] ERROR TeaCommerce.Api.Web.FormPostHandler - FormPost error --- Form data: -- AddOrUpdateOrderLine = "productIdentifier, quantity" -- storeId = "1" -- productIdentifier = "1388" -- quantity = "1"
System.InvalidOperationException: Invalid attempt to call Read when reader is closed. at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) at System.Data.SqlClient.SqlDataReader.Read() at umbraco.DataLayer.RecordsReaderAdapter
1.Read() at TeaCommerce.Umbraco.Configuration.Compatibility.Domain.GetDomainsById(Int32 nodeId) at TeaCommerce.Umbraco.Configuration.Services.LanguageService.GetLanguageIdByNodePath(String nodePath) at TeaCommerce.Umbraco.Configuration.InformationExtractors.PublishedContentProductInformationExtractor.GetSnapshot(String productIdentifier) at TeaCommerce.Api.Models.OrderLineCollection.AddOrUpdate(String productIdentifier, Nullable
1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier) at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderLine(Int64 storeId, String productIdentifier, Nullable
1 quantity, IDictionary2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier) at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderLine(Int64 storeId, IDictionary
2 formFields, IDictionary`2 settings) at TeaCommerce.Api.Web.FormPostHandler.FormPost()Still the same error as before :) Need a way to help you debug and reproduce. I can not do that on my own local machine and hosting setup.
Kind regards
Anders
I have no tried changing that domain method to a different method using UmbracoContext and now everything works :).
So we can confirm that this is the solution.
Awesome! - Can you post your code? :-)
Nothing dramatic. I just switched the database reader to the PetaPoco one.
Might be nicer to use a model but I assume Anders will do a proper fix anyway so this was just quick and dirty ;).
Hi
Is there a timeframe for a release of this fix? We are experiencing the same issue.
Thanks
Niall
Not yet. But you can download and build the project with the fix here: https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/tree/dev
Just download and go to the build folder and run the release bat file. You just need VS so you have MS build. Then you will have a zip file to install or just overwrite the bin file.
Let me know if that works for you.
Kind regards
Anders
Brill - thanks Anders, this has been an annoying show stopper for a while - so it'll be nice to get an official release for it. Us being paying licensee owners :-)
Sorry about that. We will see if we can get a release pretty soon then :)
Hi Anders,
Any further news on an update? We have a few clients also waiting for an official release.
Thanks
Hi Simon
Please vote for this issue as it limits us for releasing an update at the moment.
http://issues.umbraco.org/issue/U4-10519
Kind regards
Anders
Hi Anders,
Looks like the Umbraco team fixed this, all good your end now?
Hi Simon
Yes it should be fixed. We will test this week.
Hi!
Is anybody experiencing the exception with umbraco 7.6.4?
When I try and add the product tothe order, via the javascript API, this error occurs.
Resolved the issue by updating to 3.2.3 with umbraco 7.6.4, all working correctly.
is working on a reply...