Migration: Client Breaking Changes


The features listed on this page were available in former RavenDB versions and are unavailable in RavenDB 6.x,
or their behavior is inconsistent with their behavior in previous versions.

Breaking changes

  • Include from a Non-tracking session
    A non-tracking session will now throw the following exception if an 'Include' operation is used in it,
    to indicate that the operation is forbidden in a non-tracking session and to warn about its expected results.

    "This session does not track any entities, because of that registering includes is forbidden
    to avoid false expectations when later load operations are performed on those and no requests
    are being sent to the server.
    Please avoid any 'Include' operations during non-tracking session actions like load or query."
    
  • Type changes
    Many methods related to paging information (Skip, Take, PageSize, TotalResults, etc.) that used the int type in former RavenDB versions now use long, e.g. QueryStatistics.TotalResults.

  • Indexing
    The default value of the Indexing.OrderByTicksAutomaticallyWhenDatesAreInvolved configuration option is now true.

  • Facets
    FacetOptions were removed from RangeFacet.

  • Obsolete entities removed
    Many obsolete attributes, properties, and methods were removed from the public API.

  • Certificate disposal
    The DisposeCertificate convention has been introduced to prevent or allow the disposal of DocumentStore.Certificate when the store is disposed, helping users mitigate the X509Certificate2 leak.

  • Serialization
    Only Public fields are serialized/deserialized when projecting query results.
    Private fields are not serialized/deserialized.

  • HiLo ID generator
    DefaultAsyncHiLoIdGenerator is replaced with AsyncHiLoIdGenerator

    public AsyncHiLoIdGenerator(string tag, DocumentStore store, string dbName, char identityPartsSeparator)

Breaking changes in a sharded database

Unsupported features:

RavenDB 6.0 introduces sharding.
Features that are currently unavailable under a sharded database (but remain available in regular databases) are listed in the sharding unsupported features page.
Attempting to use these features when the database is sharded will normally throw a NotSupportedInShardingException exception.


Casting smuggler results:

The result sets returned by Smuggler and features that use it (import, export, Backup and Restore) are sharding-specific and should not be cast to a non-sharded type.

For example, the following code will fail when the database is sharded.

var operation = await store.Maintenance.SendAsync(new BackupOperation(config));
var result = await operation.WaitForCompletionAsync(TimeSpan.FromSeconds(60));

// This will fail with a sharded database
var backupResult = (BackupResult)result;

For the code to succeed, replace the last line with:

var backupResult = (ShardedBackupResult)result;

Sharding-specific types

  • For Backup: ShardedBackupResult
  • For Restore: ShardedRestoreResult
  • For Smuggler, Import, and Export: ShardedSmugglerResult


Endpoints:

  • GET /databases/*/revisions/bin
    Pass start instead of etag.
    We now fetch from the last entry backward rather than from a specific etag.

    GetRevisionsBinEntryCommand
    Previous definition: GetRevisionsBinEntryCommand(long etag, int? pageSize)
    Current definition: GetRevisionsBinEntryCommand(int start, int? pageSize)

  • GET /databases/*/indexes/terms
    The Terms field of the returned results is now List<String> instead of HashSet<String>.

    public class TermsQueryResult
      {
         public List<string> Terms { get; set; }
         public long ResultEtag { get; set; }
         public string IndexName { get; set; }
      }
  • GET database/*/debug/documents/get-revisions
    Operation parameter changed from etag to start.

Do you need any help with Migration?