RavenDB 4.0.40016

33 views
Skip to first unread message

Derek den Haas

unread,
Jul 18, 2017, 2:05:11 PM7/18/17
to RavenDB - 2nd generation document database
When doing a lot of queries (paging) fast 1 after another, I get the following error:

Exception thrown: 'System.IO.InvalidDataException' in System.Private.CoreLib.ni.dll: 'Number cannot end with char with: 'Z' (90) at  (1,3844) around: 81920Z"}},{"Code":"CHAME CRYSTAL PEARL","Name":{"de":"CHAME CRYSTAL PEARL","en":"CHAME CRYSTAL PEARL","fr":"CHAME CRYSTAL PEARL","nl":"CHAME CRYSTAL PEARL"},"VBNArticleId":"VBNArticles/Base/10770","Color":"colors/Base/620","SecondaryColor":null,"ArticleGroupId":"articlegroups/2","VATRateId":"vatrates/2","[...]

To me it seems that it's giving just a part of the stream (last bit) and the JSON converter is failing on it.

It's just a plain query:

IAsyncDocumentSession session;
var list = await session.Query<ArticleAll>().Where(a => a.StartsWith("a"))
                .Statistics(out statistics)
                .Skip(request.From)
                .Take(request.Limit)
                .As<Article>()
                .ToListAsync();

Highlighted the parts that MIGHT have something to do with it.

Derek den Haas

unread,
Jul 18, 2017, 2:18:24 PM7/18/17
to RavenDB - 2nd generation document database
P.s. it's randomly failing. It's quering on scroll, so when scrolling fast the error's will apear (no scroll delay yet) and when scrolling to bottom more slowly no errors appear.

Also got:
Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.ni.dll: 'Could not convert document articles/<random id> to entity of type Beta.Core.Base.Entities.Article'
-- This document is loading when I scroll slowly

Also sometimes in the middle of a string with the error displayed above.

Op dinsdag 18 juli 2017 20:05:11 UTC+2 schreef Derek den Haas:

Oren Eini (Ayende Rahien)

unread,
Jul 18, 2017, 2:54:07 PM7/18/17
to ravendb
Can you share a way to reproduce this?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek den Haas

unread,
Jul 18, 2017, 3:25:09 PM7/18/17
to RavenDB - 2nd generation document database
I'll try in the morning (UTC+2) was hoping it was already known, I suspect that the above function:

for(var x = 0; x < 100; x++) {
var list = await session.Query<ArticleAll>()
                .Statistics(out statistics)
                .Skip(0)
                .Take(25)
                .As<Article>()
                .ToListAsync();
Thread.Sleep(50);
}

will trigger it, since it's failing every time it has a queue.

Op dinsdag 18 juli 2017 20:54:07 UTC+2 schreef Oren Eini:
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Derek den Haas

unread,
Jul 18, 2017, 3:25:33 PM7/18/17
to RavenDB - 2nd generation document database
above = below...

Op dinsdag 18 juli 2017 21:25:09 UTC+2 schreef Derek den Haas:

Derek den Haas

unread,
Jul 18, 2017, 3:31:46 PM7/18/17
to RavenDB - 2nd generation document database
No it won't, since my JS isn't awaiting requests, I think we have to do this async as well

var runner = new List<Task<Article>>();


for(var x = 0; x < 100; x++) {
    using(var session = store.StartTransaction()) {
        runner.Add(session.Query<ArticleAll>()
                .Statistics(out statistics)
                .Skip(0)
                .Take(25)
                .As<Article>()
                .ToListAsync());
    }
}

Task.WaitAll(runner);

Might fail because the session is disposed before it has ran, so maybe remove the using()

Op dinsdag 18 juli 2017 21:25:33 UTC+2 schreef Derek den Haas:

Oren Eini (Ayende Rahien)

unread,
Jul 18, 2017, 3:37:08 PM7/18/17
to ravendb
Yes, if you aren't waiting for the session, you are going to get into some invalid state.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Derek den Haas

unread,
Jul 18, 2017, 3:47:30 PM7/18/17
to RavenDB - 2nd generation document database
var runner = new List<Task<IList<Article>>>();
QueryStatistics statistics;
for(var x = 0; x < 100; x++) {
var session = _session.Advanced.DocumentStore.OpenAsyncSession();
runner.Add(session.Query<ArticleAll>()
.Statistics(out statistics)
.Skip(0)
.Take(25)
.As<Article>()
.ToListAsync());
}

Task.WaitAll(runner.ToArray());

Was hoping this failed... Situation:
JS is calling page 1 to 30 in 100ms, (scrolling fast by dragging scrollbar).

C# is doing:
Trancient<IAsyncDocumentSession>() <-- generates a IAsyncDocumentSession from Store.StartTransaction();


await session.Query<ArticleAll>()
                        .Statistics(out statistics)
                        .Skip(0)
                        .Take(25)
                        .As<Article>()
                        .ToListAsync()

Disposal of IAsyncDocumentSession

Though doing almost the same won't fail. It's the blit which is failing. I'll try to create something in the morning, cause it shouldn't be that complicated.

It's calling page 1, 2, 3, 4, .. 30, because the user is scrolling quick. Haven't added a 
Op dinsdag 18 juli 2017 21:37:08 UTC+2 schreef Oren Eini:
Reply all
Reply to author
Forward
0 new messages