void ApplyConventions(ReadOnlySettings settings)
        {
            if (DocumentIdConventionsExtensions.NeedToApplyDocumentIdConventionsToDocumentStore(settings))
            {
                var sagasEnabled    = settings.IsFeatureActive(typeof(Sagas));
                var timeoutsEnabled = settings.IsFeatureActive(typeof(TimeoutManager));
                var idConventions   = new DocumentIdConventions(docStore, settings.GetAvailableTypes(), settings.EndpointName(), sagasEnabled, timeoutsEnabled);
                docStore.Conventions.FindTypeTagName = idConventions.FindTypeTagName;
            }

            var store = docStore as DocumentStore;

            if (store == null)
            {
                return;
            }

            var isSendOnly = settings.GetOrDefault <bool>("Endpoint.SendOnly");

            if (!isSendOnly)
            {
                var usingDtc = settings.GetRequiredTransactionModeForReceives() == TransportTransactionMode.TransactionScope;
                if (usingDtc)
                {
                    throw new Exception("RavenDB Persistence does not support Distributed Transaction Coordinator (DTC) transactions. You must change the TransportTransactionMode in order to continue. See the RavenDB Persistence documentation for more details.");
                }
            }
#if NET452
            store.EnlistInDistributedTransactions = false;
#endif
        }
예제 #2
0
        void IsTransactional(ReadOnlySettings readOnlySettings)
        {
            #region 5to6IsTransactional

            bool isTransactional = readOnlySettings.GetRequiredTransactionModeForReceives() != TransportTransactionMode.None;

            #endregion
        }
예제 #3
0
        void SuppressDistributedTransactions(ReadOnlySettings readOnlySettings)
        {
            #region 5to6SuppressDistributedTransactions

            bool suppressDistributedTransactions = readOnlySettings.GetRequiredTransactionModeForReceives() != TransportTransactionMode.TransactionScope;

            #endregion
        }
예제 #4
0
        void IsTransactional(ReadOnlySettings readOnlySettings)
        {
            #region 5to6IsTransactional

            bool isTransactional = readOnlySettings.GetRequiredTransactionModeForReceives() != TransportTransactionMode.None;

            #endregion
        }
예제 #5
0
        void SuppressDistributedTransactions(ReadOnlySettings readOnlySettings)
        {
            #region 5to6SuppressDistributedTransactions

            bool suppressDistributedTransactions = readOnlySettings.GetRequiredTransactionModeForReceives() != TransportTransactionMode.TransactionScope;

            #endregion
        }
        internal static void VerifyStorageEngineSupportsDtcIfRequired(IDocumentStore store, ReadOnlySettings settings)
        {
            var suppressDistributedTransactions = settings.GetRequiredTransactionModeForReceives() != TransportTransactionMode.TransactionScope;
            if (suppressDistributedTransactions)
            {
                return;
            }

            if (settings.GetOrDefault<bool>("RavenDB.IConfirmToUseAStorageEngineWhichDoesntSupportDtcWhilstLeavingDistributedTransactionSupportEnabled"))
            {
                return;
            }

            var stats = store.DatabaseCommands.GetStatistics();
            if (!stats.SupportsDtc)
            {
                throw new InvalidOperationException(StorageEngineDoesntSupportDtcMessage);
            }
        }
예제 #7
0
        void ApplyConventions(ReadOnlySettings settings)
        {
            var store = docStore as DocumentStore;
            if (store == null)
            {
                return;
            }

            UnwrappedSagaListener.Register(store);

            var isSendOnly = settings.GetOrDefault<bool>("Endpoint.SendOnly");
            if (!isSendOnly)
            {
                var usingDtc = settings.GetRequiredTransactionModeForReceives() == TransportTransactionMode.TransactionScope;
                if (usingDtc)
                {
                    throw new Exception("RavenDB does not support Distributed Transaction Coordinator (DTC) transactions. You must change the TransportTransactionMode in order to continue. See the RavenDB Persistence documentation for more details.");
                }
            }
        }