Raven 4.0 Patch enum issues.

287 views
Skip to first unread message

Lucas bode

unread,
Feb 16, 2018, 4:08:49 PM2/16/18
to RavenDB - 2nd generation document database
I am using RavenDB 4.0 and am hoping to use the new Patch functionality. It works for most of the properties I want to update but seems to throw an error if I want to update a property of type enum. The enum works fine for the rest of the RavenDB operations (GET, POST, PUT), but for some reason the Patch doesn't seem to like it. Anyone have any idea what could be going on? I've posted a code snippet and stack trace below...

Note - JobStatus is of type enum

using (var session = Store.OpenAsyncSession())
{
try
{
session.Advanced.Patch<Job, JobStatus>(id, a => a.Status, JobStatus.Complete);
await session.SaveChangesAsync();
}
catch (Exception ex)
{
Log.Error(ex, "Error patching document");
throw;
}
}

Cannot perform ReadValue when encountered the ReadObjectDocument state


   at Sparrow.Json.ManualBlittableJsonDocumentBuilder`1.ThrowIllegalStateException(ContinuationState state, String realOperation) in C:\Builds\RavenDB-Stable-4.0\src\Sparrow\Json\ManualBlittableJsonDocumentBuilder.cs:line 566
   at Sparrow.Json.ManualBlittableJsonDocumentBuilder`1.FinishWritingScalarValue(BuildingState currentState) in C:\Builds\RavenDB-Stable-4.0\src\Sparrow\Json\ManualBlittableJsonDocumentBuilder.cs:line 550
   at Sparrow.Json.ManualBlittableJsonDocumentBuilder`1.WriteValue(String value) in C:\Builds\RavenDB-Stable-4.0\src\Sparrow\Json\ManualBlittableJsonDocumentBuilder.cs:line 465
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
   at Raven.Client.Json.TypeConverter.ToBlittableSupportedType(Object value, DocumentConventions conventions, JsonOperationContext context) in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Json\TypeConverter.cs:line 73
   at Raven.Client.Json.TypeConverter.ToBlittableSupportedType(Object value, DocumentConventions conventions, JsonOperationContext context) in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Json\TypeConverter.cs:line 52
   at Raven.Client.Documents.Operations.PatchRequest.ToJson(DocumentConventions conventions, JsonOperationContext context) in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Documents\Operations\PatchRequest.cs:line 55
   at Raven.Client.Documents.Commands.Batches.PatchCommandData.ToJson(DocumentConventions conventions, JsonOperationContext context) in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Documents\Commands\Batches\PatchCommandData.cs:line 28
   at Raven.Client.Documents.Commands.Batches.BatchCommand..ctor(DocumentConventions conventions, JsonOperationContext context, List`1 commands, BatchOptions options) in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Documents\Commands\Batches\BatchCommand.cs:line 33
   at Raven.Client.Documents.Session.Operations.BatchOperation.CreateRequest() in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Documents\Session\Operations\BatchOperation.cs:line 34
   at Raven.Client.Documents.Session.AsyncDocumentSession.<SaveChangesAsync>d__20.MoveNext() in C:\Builds\RavenDB-Stable-4.0\src\Raven.Client\Documents\Session\AsyncDocumentSession.cs:line 118
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MTK.Repo.RavenRepository`1.<Patch>d__9`2.MoveNext() in C:\Workspace\MTK.Api\src\MTK.Repo\RavenRepository.cs:line 116

Tal Weiss

unread,
Feb 18, 2018, 4:39:54 AM2/18/18
to RavenDB - 2nd generation document database
Thank you for reporting this you can follow the issue here http://issues.hibernatingrhinos.com/issue/RavenDB-10528

--
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.



--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

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

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

Oren Eini (Ayende Rahien)

unread,
Feb 18, 2018, 9:30:51 AM2/18/18
to ravendb
This is now fixed and merged, will be available in the next build

Hibernating Rhinos Ltd  

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

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

 

Oren Eini (Ayende Rahien)

unread,
Feb 18, 2018, 9:31:00 AM2/18/18
to ravendb
Next nightly build

Lucas bode

unread,
Feb 20, 2018, 10:07:59 AM2/20/18
to RavenDB - 2nd generation document database
Awesome, thank you!
Next nightly build
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

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

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

--
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+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages