store.Operations.Send(new PatchCollectionOperation("stuffs", new PatchRequest
{
Script = "this.Key = this.Key + 1;"
})).WaitForCompletion(TimeSpan.FromSeconds(15));
newSession.Advanced.OnBeforeStore += eventTest2;
private void eventTest2(object sender, BeforeStoreEventArgs e)
{
var user = e.Entity as User;
if (user != null)
{
user.LastName = "ravendb";
}
}8) Url -> Urls, DefaultDatabase -> Database
Hibernating Rhinos Ltd
Oren Eini l CEO l 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.
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.
--
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.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
Thanks for answering Oren.Some more questions:1. DocumentKeyGenerator works with all entity types. RegisterAsyncIdConvention needs to be used with all entity types seperately? I was doing this in 3.5:DocumentStore.Conventions.DocumentKeyGenerator =(dbname, commands, entity) => DocumentStore.Conventions.GetTypeTagName(entity.GetType()) + "/";How to go about this in 4.0?
2. How do we implement IDocumentConversionListener? I used it to load etags in 3.5. Does this happen automatically now, or do we still need to do this manually?
3. Has EnsureDatabaseExists method been removed? And what about StartIndexing & StopIndexing?
_store.Admin.Send(new StopIndexingOperation());
_store.Admin.Send(new StartIndexingOperation());
4. Is there any way to check server availability in 4.0?
I was shifting a big project to 4.0. The project is still under development. So many breaking changes without any documentation are making me rethink about jumping on 4.0 so early. Will you recommend me to wait?
I am also curious about the decision behind etag to long. A blog entry on ayende would be a nice read, I guess.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
public class DocumentConversionListener : IDocumentConversionListener
{
...
public void AfterConversionToEntity(string key, RavenJObject document, RavenJObject metadata, object entity)
{
var entityWithEtag = entity as IHasEtag;
if (entityWithEtag != null)
entityWithEtag.Etag = metadata.Value<Guid>("@etag");
}
}
new PatchCommandData
{
Key = Id,
Patches = new[]
{
new PatchRequest
{
Type = PatchCommandType.Modify,
Name = nameof(Items),
Position = index,
Nested = new[]
{
new PatchRequest { Type = PatchCommandType.Set, Name = "HasBeenPosted", Value = new RavenJValue(true) },
}
}
}
};
Hibernating Rhinos Ltd
Grisha Kotler l RavenDB Core Team Developer l Mobile: +972-54-586-8647
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
RavenDB paving the way to "Data Made Simple" http://ravendb.net/
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
store.Conventions.DeserializeEntityFromBlittable = (type, doc) =>
{
var entity = new JsonNetBlittableEntitySerializer(store.Conventions).EntityFromJsonStream(type, doc);
if (entity is IHasEtag hasEtag)
{
if (doc.TryGet(Constants.Documents.Metadata.Key, out BlittableJsonReaderObject metadata) &&
doc.TryGet(Constants.Documents.Metadata.Etag, out long etag))
{
hasEtag.Etag = etag;
}
}
return entity;
};
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Sorry, use:
var old = store.Conventions.DeserializeEntityFromBlittable;
store.Conventions.DeserializeEntityFromBlittable = (type, doc) =>
{
var entity = old(type, doc);
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
"That most certainly shouldn't be able to do that."I didn't get that. It should not be able to create the database? So the exception is intentional?
No, you shouldn't get the verification exception
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Thu, Jun 15, 2017 at 8:48 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
"That most certainly shouldn't be able to do that."I didn't get that. It should not be able to create the database? So the exception is intentional?
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
Thanks. It is working now. Although there is another issue. Sometimes documentStore.Admin.Server.Send just hangs. I cannot reproduce this as it is pretty random.Secondly, I am getting a ThrowAlreadyDisposedException with some operations:{"Cannot access a disposed object.\r\nObject name: 'This ArenaMemoryAllocator is already disposed'."}at Sparrow.Json.ArenaMemoryAllocator.ThrowAlreadyDisposedException()at Sparrow.Json.BlittableWriter`1.ResetAndRenew()at Sparrow.Json.BlittableJsonDocumentBuilder.Renew(String debugTag, UsageMode mode)at Sparrow.Json.JsonOperationContext.ReadObjectInternal(Object builder, String documentId, UsageMode mode, IBlittableDocumentModifier modifier)at Raven.Client.Documents.Session.InMemoryDocumentSessionOperations.StoreEntityInUnitOfWork(String id, Object entity, Nullable`1 etag, DynamicJsonValue metadata, ConcurrencyCheckMode forceConcurrencyCheck)at Raven.Client.Documents.Session.InMemoryDocumentSessionOperations.StoreInternal(Object entity, Nullable`1 etag, String id, ConcurrencyCheckMode forceConcurrencyCheck)at Raven.Client.Documents.Session.InMemoryDocumentSessionOperations.Store(Object entity, Nullable`1 etag, String id)at NovusERP.Data.Repositories.RavenDB.DocumentRepository.Store[TEntity](TEntity item) in D:\Short Utilities\Novus\NovusERP\NovusERP.Data\Repositories\RavenDB\DocumentRepository.cs:line 90Trying to reproduce this in a test but cannot. It is not random as it happening only at specific locations.
Also found something interesting:public class ParentObject{public string Name { get; set; }}public class ChildObject{public string Name { get; set; }public ParentObject Parent { get; set; }}var p = new ParentObject { Name = "xyz" };// In ravendb 3.x, I had to use NextIdentityFor with p here...// In 4.x this works without NextIdentityFor ...var c = new ChildObject { Name = "abc", Parent = p };session.Store(p);session.Store(c);session.SaveChanges();
--
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.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
Yes. I am initializing the DocumentStore twice. Once to see if the database exists or not and creating it if it's not (local), and then for a application wide use (global). If I merge the two things the issue goes away.
--
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
Yes. I am initializing the DocumentStore twice. Once to see if the database exists or not and creating it if it's not (local), and then for a application wide use (global). If I merge the two things the issue goes away.
--
Or using it after dispose?
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Sat, Jun 17, 2017 at 12:19 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
Yes. I am initializing the DocumentStore twice. Once to see if the database exists or not and creating it if it's not (local), and then for a application wide use (global). If I merge the two things the issue goes away.
--
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.
--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/j1nBCHmBBe0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
I can now reproduce this error consistently. Attached a test project at:
--
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.
Indexes.Add(x => x.Address, FieldIndexing.Analyzed);
Thanks, we'll have a solution for it this week
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Fri, Jul 7, 2017 at 12:15 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
I can now reproduce this error consistently. Attached a test project at:
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
store.JsonRequestFactory.RequestTimeout = TimeSpan.FromHours(1);
store.SetRequestsTimeout(TimeSpan.FromHours(1))
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Sorry, use:
var old = store.Conventions.DeserializeEntityFromBlittable;store.Conventions.DeserializeEntityFromBlittable = (type, doc) =>
{
var entity = old(type, doc);
if (entity is IHasEtag hasEtag)
{
if (doc.TryGet(Constants.Documents.Metadata.Key, out BlittableJsonReaderObject metadata) &&
doc.TryGet(Constants.Documents.Metadata.Etag, out long etag))
{
hasEtag.Etag = etag;
}
}
return entity;
};
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Tue, Jun 13, 2017 at 4:08 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:Cannot find JsonNetBlittableEntitySerializer. Which assembly contains this class?
On Tuesday, June 13, 2017 at 6:09:05 PM UTC+5:30, Oren Eini wrote:store.Conventions.DeserializeEntityFromBlittable = (type, doc) =>
{
var entity = new JsonNetBlittableEntitySerializer(store.Conventions).EntityFromJsonStream(type, doc);
if (entity is IHasEtag hasEtag)
{
if (doc.TryGet(Constants.Documents.Metadata.Key, out BlittableJsonReaderObject metadata) &&
doc.TryGet(Constants.Documents.Metadata.Etag, out long etag))
{
hasEtag.Etag = etag;
}
}
return entity;
};
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Tue, Jun 13, 2017 at 3:16 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:Never work with Blittable format before. Also I don't know the api.As I mentioned before, I want to implement this from 3.5 in 4.0 using DeserializeEntityFromBlittable, but don't know how to:
public class DocumentConversionListener : IDocumentConversionListener
{
...
public void AfterConversionToEntity(string key, RavenJObject document, RavenJObject metadata, object entity)
{
var entityWithEtag = entity as IHasEtag;
if (entityWithEtag != null)
entityWithEtag.Etag = metadata.Value<Guid>("@etag");
}
}
On Tuesday, June 13, 2017 at 5:12:24 PM UTC+5:30, Oren Eini wrote:What do you need?
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Tue, Jun 13, 2017 at 11:51 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:Some help with DeserializeEntityFromBlittable will be nice.
On Tuesday, June 13, 2017 at 1:31:09 PM UTC+5:30, Yogesh Jagota wrote:I will post the test as soon as my projects builds. Just need to bypass usage of SeedIdentityFor & NextIdentityFor somehow.
On Tuesday, June 13, 2017 at 11:34:29 AM UTC+5:30, Oren Eini wrote:This should work, can you end a failing test case?
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Tue, Jun 13, 2017 at 7:37 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:session.Advanced.Patch<Item, bool>(_docId, u => u.Items[index].HasBeenPosted , true);not
session.Advanced.Patch<Item, bool>(_docId, u => u[index].HasBeenPosted , true);On Tuesday, June 13, 2017 at 10:03:09 AM UTC+5:30, Yogesh Jagota wrote:Thanks for the replies.I tried this already:session.Advanced.Patch<Item, bool>(_docId, u => u[index].HasBeenPosted , true);My test is failing. As my full project cannot be completely build because of the changes as of now, will check when all issues are ironed out.
On Tuesday, June 13, 2017 at 1:19:31 AM UTC+5:30, Grisha Kotler wrote:1. Don't need it anymore. If there will be more than 1024 results per document, you'll see a warning in the studio.2. Yes3. I don't think that we've implemented the client side commands for that.4. null will work.We'll compare the current document etag with the provided etag (if not null). The command will fail in case of a mismatch.You can do it using the new patching API:session.Advanced.Patch<Item, bool>(_docId, u => u[index].HasBeenPosted , true);See:Hibernating Rhinos Ltd
Grisha Kotler l RavenDB Core Team Developer l Mobile: +972-54-586-8647
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
RavenDB paving the way to "Data Made Simple" http://ravendb.net/
On 12 June 2017 at 22:24, Yogesh Jagota <justj...@jagotagroup.com> wrote:Some more questions:1. MaxIndexOutputsPerDocument setting is no longer present. Do we don't need it anymore?2. SortOptions.Double is gone. Use SortOptions.Numeric?3. Cannot find SeedIdentityFor & NextIdentityFor.4. DeleteCommandData now requires the etag (long?) along with the id in the constructor. Will null work? What does etag do here?Also, I can't seem to figure out how to do something like this:
new PatchCommandData
{
Key = Id,
Patches = new[]
{
new PatchRequest
{
Type = PatchCommandType.Modify,
Name = nameof(Items),
Position = index,
Nested = new[]
{
new PatchRequest { Type = PatchCommandType.Set, Name = "HasBeenPosted", Value = new RavenJValue(true) },
}
}
}
};Something along these lines:repo.Session.Advanced.Patch(this, l => l.Items, i => i[index].HasBeenPosted = true);On Monday, June 12, 2017 at 8:54:00 PM UTC+5:30, Yogesh Jagota wrote:I am using IDocumentConversionListener for loading etag values, something like this:
public class DocumentConversionListener : IDocumentConversionListener
{
...
public void AfterConversionToEntity(string key, RavenJObject document, RavenJObject metadata, object entity)
{
var entityWithEtag = entity as IHasEtag;
if (entityWithEtag != null)
entityWithEtag.Etag = metadata.Value<Guid>("@etag");
}
}
Is this automatically in 4.0 or should I use DeserializeEntityFromBlittable?By server availability, I mean, can we somehow check that is the server online or not?EnsureDatabaseExists is very helpful in my app, but I think I can find a way around it or write my own method. But I really think that it was a nice method to have. A doesdatabaseexists/createdatabase method with fluent db settings will be even better. Just my 2 cents.And once again, thanks for the replies. Much appreciated. I am moving my app to 4.0 as we speak.On Monday, June 12, 2017 at 1:51:53 PM UTC+5:30, Oren Eini wrote:inline
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Sun, Jun 11, 2017 at 7:55 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:Thanks for answering Oren.Some more questions:1. DocumentKeyGenerator works with all entity types. RegisterAsyncIdConvention needs to be used with all entity types seperately? I was doing this in 3.5:DocumentStore.Conventions.DocumentKeyGenerator =(dbname, commands, entity) => DocumentStore.Conventions.GetTypeTagName(entity.GetType()) + "/";How to go about this in 4.0?In 4.0, this is a pretty bad idea.The section about: Identity generation strategyWe have a "users|" mode, which does something similar, but it generates IDs that look like:users/0000000000000001332-A2. How do we implement IDocumentConversionListener? I used it to load etags in 3.5. Does this happen automatically now, or do we still need to do this manually?What is it that you are trying to do?There is DeserializeEntityFromBlittable which is the new endpoint for that.3. Has EnsureDatabaseExists method been removed? And what about StartIndexing & StopIndexing?Yes, you need to create the db yourself.You can write it on your own, though, but it turns out that db settings are quite important and creating it on the fly causes issues._store.Admin.Send(new StopIndexingOperation());_store.Admin.Send(new StartIndexingOperation());4. Is there any way to check server availability in 4.0?What do you mean by that?I was shifting a big project to 4.0. The project is still under development. So many breaking changes without any documentation are making me rethink about jumping on 4.0 so early. Will you recommend me to wait?Go ahead and start, we are working on all of that, but it will be something that you'll need to do at some point anyway.We are working on all those things, including the list of breaking changes, but having people actually talk to us about what they are using is best.I am also curious about the decision behind etag to long. A blog entry on ayende would be a nice read, I guess.I'll write something, it will show up tomorrow.
On Sunday, June 11, 2017 at 7:17:02 PM UTC+5:30, Kijana Woodard wrote:I'd be interested to learn more about the back story on "3) Etag -> long".I don't have an opinion other than I vaguely remember running into an issue working with the Etag type once, but nothing major.
On Sun, Jun 11, 2017 at 6:15 AM, Oren Eini (Ayende Rahien) <aye...@ayende.com> wrote:
We'll have the breaking change list for RC, IIRC.
1) WaitForNonStaleResultsAsOfLastWrite has been replaced with WaitForNonStaleResultsAsOf(long cutOffEtag);You can track the last etag yourself, since the global tracking didn't work very well for complex scenarios.However, a much better alternative is to shift the cost to WaitForIndexesAfterSaveChanges.2) RavenQueryStatistics -> QueryStatistics3) Etag -> long4) DatabaseCommands has been removed, a lot of the functionality exists in operations.store.Operations.Send(new PatchCollectionOperation("stuffs", new PatchRequest
{
Script = "this.Key = this.Key + 1;"
})).WaitForCompletion(TimeSpan.FromSeconds(15));5) DocumentKeyGenerator -> RegisterAsyncIdConvention6) JsonRequestFactory -> RequestExecuter (and you probably don't need to touch it)7) IDocumentStoreListener was changed to events.newSession.Advanced.OnBeforeStore += eventTest2;private void eventTest2(object sender, BeforeStoreEventArgs e)
{
var user = e.Entity as User;
if (user != null)
{
user.LastName = "ravendb";
}
}8) Url -> Urls, DefaultDatabase -> Database
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
On Sun, Jun 11, 2017 at 10:55 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:Hello,Is there any information source on the breaking changes made in RavenDB 4?What I cannot find:1. WaitForNonStaleResultsAsOfLastWrite.2. RavenQueryStatistics3. Etag - ???4. IDocumentStore.DatabaseCommands5. IDocumentStore.Conventions.DocumentKeyGenerator6. IDocumentStore.JsonRequestFactory7. IDocumentStoreListener & RegisterListener8. DocumentStore doesn't have Url and DefaultDatabase fields anymoreAny many more....Some which are mentioned in the blog:1. Patch commandsPS: There are a lot of namespace changes, so maybe I am unable to find the current namespace.Any help will be appreciated.