Error and lots of queries

Dec 6, 2011 at 11:23 AM

Because i retrieve the following error when i navigate in the backend to the taxnonomies section in the backend:

System.ArgumentException: Value cannot be null or empty.

@Html.ActionLink(Html.Encode(taxonomyEntry.Taxonomy.Name), "Index", "TermAdmin", new { taxonomyId = taxonomyEntry.Taxonomy.Id }, new object { })

I saw that the GetTaxonomies() service from TaxonomyService returns only one result and the only result contains a null value of Name,Slug and TermTypeName. So that's why the error occurs. First question. what can be the problem of this and how can i fix this?

second: I see that when i profile the following query:  _contentManager.Query<TaxonomyPart>().List();  in the GetTaxnonomies() service method:

it results in 8252 queries in sql profiler. Is there something wrong with this or is this normal behavior?

Dec 6, 2011 at 6:11 PM

 

Whoa that’s huge, let me take a look at what’s wrong, I have never tried with so many terms, this might uncover some bad code.

Mar 14, 2012 at 11:38 AM
sebastienros wrote:

 

Whoa that’s huge, let me take a look at what’s wrong, I have never tried with so many terms, this might uncover some bad code.

Did you take a look at this yet?

Because with 1.4 I notice the same issues... It does one query per user.

So in my case, the following query (@p0 int)SELECT this_.Id as Id609_0_, this_.UserId as UserId609_0_, this_.Role_id as Role3_609_0_ FROM Orchard_Roles_UserRolesPartRecord this_ WHERE this_.UserId = @p0

was executed 11000 times!

Fyi, it doesn't matter if I have a term or not, but atm I only have _1_ term...

Apr 2, 2012 at 4:14 PM

Sebastien, any progress on this issue?

Apr 4, 2012 at 6:22 PM

Yeah, I'm experiencing the same problem. I've added just a few taxonomies and terms to my application. I've set them up as fields on a few of my content parts. Two of these content parts have large datasets (several thousand records), and when I try to do basic queries on these parts, thousands of queries get generated in SQL profiler.

Also, when using TaxonomyService.GetTaxonomies() to simply get the taxonomies, I end up with thousands of these queries running again. Is this expected behavior, am I doing something wrong, or is this a bug?

Apr 5, 2012 at 2:05 PM
SaaSDeveloper wrote:

Yeah, I'm experiencing the same problem. I've added just a few taxonomies and terms to my application. I've set them up as fields on a few of my content parts. Two of these content parts have large datasets (several thousand records), and when I try to do basic queries on these parts, thousands of queries get generated in SQL profiler.

Also, when using TaxonomyService.GetTaxonomies() to simply get the taxonomies, I end up with thousands of these queries running again. Is this expected behavior, am I doing something wrong, or is this a bug?

SaaSDeveloper, vote-up the issue @ http://orchard.codeplex.com/workitem/18561