New to Raven DB - ID's increment by 32, is this normal?

131 views
Skip to first unread message

ghandicap

unread,
Apr 16, 2014, 3:58:34 PM4/16/14
to rav...@googlegroups.com
I just got RavenDB up and running and I'm successfully saving and retrieving records. I noticed that my record Id's all increment by 32, is this normal behaviour for the database?

Example:
  • Cars/1
  • Cars/33
  • Cars/65
  • Cars/97
  • Cars/129
  • And so on...

Oren Eini (Ayende Rahien)

unread,
Apr 16, 2014, 4:01:36 PM4/16/14
to ravendb



Oren Eini

CEO

Mobile: + 972-52-548-6969

Office:  + 972-4-674-7811

Fax:      + 972-153-4622-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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Marisic

unread,
Apr 16, 2014, 5:10:46 PM4/16/14
to rav...@googlegroups.com
If you see this jump every time, it seems you're not managing the session properly.

You should not be calling SaveChanges on every single Store() just at the end.

Given your example if 6 cars with an empty database a single SaveChanges should result in

cars/1
cars/2
cars/3
cars/4
cars/5
cars/6

If you do the operation again, you should see it jump. 

ghandicap

unread,
Apr 16, 2014, 8:13:13 PM4/16/14
to rav...@googlegroups.com
Thank you Oren!


If I understand correctly, If I happen to create more than 32 documents for a transaction, RavenDB will simply request a second batch of IDs? And then learn to get bigger batches over time if I happen to do this operation often?

If so, Thats very cool!

Oren Eini (Ayende Rahien)

unread,
Apr 16, 2014, 9:05:54 PM4/16/14
to ravendb
Yes
Reply all
Reply to author
Forward
0 new messages