Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7785769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:18:31+00:00 2026-06-01T20:18:31+00:00

I just implemented sharding with RavenDB. When running it for the first time, this

  • 0

I just implemented sharding with RavenDB. When running it for the first time, this code:

tempShardedDocumentStore = new ShardedDocumentStore(new ShardStrategy(), shards);
tempShardedDocumentStore.Initialize();

IndexCreation.CreateIndexes(typeof(RavenDataAccess).Assembly, tempShardedDocumentStore);

… produces this error:

System.TypeInitializationException: The type initializer for ‘WriteToRaven.Data.
RavenDataAccess’ threw an exception. —> System.NotSupportedException: Sharded
document store doesn’t have a database commands.
you need to explicitly use the
shard instances to get access to the database commands

First, ShardedDocumentStore does indeed have DatabaseCommands:

enter image description here

Second, if that just won’t work, should it be done like this?

IndexCreation.CreateIndexes(typeof(RavenDataAccess).Assembly, shards[0]);

If so, now my linq query won’t work:

System.NotSupportedException: Sharded linq queries aren’t supported currently
at Raven.Client.Shard.ShardedDocumentSession.QueryT

using (IDocumentSession ravenSession = GetRavenSession())
{
    return ravenSession.Query<T>().OrderByDescending(orderByClause).FirstOrDefault();
}

How do I get this to work?

Note: GetRavenSession() returns OpenSession() from the sharded document store shown above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:18:32+00:00Added an answer on June 1, 2026 at 8:18 pm

    Bob Horn,
    What build are you using? We recently revamped the sharding support.
    We have support for linq in sharding now, as well as creating indexes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just implemented a number of custom counter_cache s using code like this: def
I just implemented Poisson Disk generation in the plane with this simple algorithm: http://people.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf
Hello I've just implemented a search option on my application use this on the
I just implemented a simple WCF server using net.tcp . First, I use 127.0.0.1
I just implemented the new Facebook comments plugin. How can I easily get a
I just implemented a remember me feature for a user login on a website.
I just implemented uploadify in my project, and I noticed what seems like an
We just implemented SVN usage at our office and the other dev and myself
I have just implemented WMD for my editor in an ASP.NET app. The problem
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.