Beispiel #1
0
        public NhProviderTransaction GenerateSessionAndTransaction(bool isReadOnly, out ISession session)
        {
            //get the session
            NhProviderTransaction transaction;

            session = GetNHibernateSession(isReadOnly);
            if (session.Transaction.IsActive)
            {
                //we have a nested transaction, lets create a new session
                //session = NhDependencyHelper.FactoryHelper.GetNHibernateSession(true);
                transaction = new NhProviderTransaction(session, true);
            }
            else
            {
                transaction = new NhProviderTransaction(session);
            }
            return(transaction);
        }
 /// <summary>
 /// Get the repository with an existing transaction
 /// </summary>
 /// <param name="transaction"></param>
 /// <param name="isReadonly"> </param>
 /// <returns></returns>
 public AbstractSchemaRepository GetRepository(NhProviderTransaction transaction, bool isReadonly)
 {
     var session = NhDependencyHelper.FactoryHelper.GetSessionFromTransaction(transaction, isReadonly);
     return new SchemaRepository(ProviderMetadata, RevisionRepositoryFactory.GetRepository(), transaction, session, FrameworkContext, isReadonly);
 }
 public NhProviderTransaction GenerateSessionAndTransaction(bool isReadOnly, out ISession session)
 {
     //get the session
     NhProviderTransaction transaction;
     session = GetNHibernateSession(isReadOnly);
     if (session.Transaction.IsActive)
     {
         //we have a nested transaction, lets create a new session
         //session = NhDependencyHelper.FactoryHelper.GetNHibernateSession(true);
         transaction = new NhProviderTransaction(session, true);
     }
     else
     {
         transaction = new NhProviderTransaction(session);
     }
     return transaction;
 }
Beispiel #4
0
        /// <summary>
        /// Create a new repo using an existing transaction
        /// </summary>
        /// <param name="transaction"></param>
        /// <param name="isReadOnly"> </param>
        /// <returns></returns>
        public AbstractRevisionRepository <TypedEntity> GetRepository(NhProviderTransaction transaction, bool isReadOnly)
        {
            var session = NhDependencyHelper.FactoryHelper.GetSessionFromTransaction(transaction, isReadOnly);

            return(new RevisionRepository(ProviderMetadata, transaction, session, FrameworkContext, isReadOnly));
        }
        /// <summary>
        /// Get the repository with an existing transaction
        /// </summary>
        /// <param name="transaction"></param>
        /// <param name="isReadonly"> </param>
        /// <returns></returns>
        public AbstractSchemaRepository GetRepository(NhProviderTransaction transaction, bool isReadonly)
        {
            var session = NhDependencyHelper.FactoryHelper.GetSessionFromTransaction(transaction, isReadonly);

            return(new SchemaRepository(ProviderMetadata, RevisionRepositoryFactory.GetRepository(), transaction, session, FrameworkContext, isReadonly));
        }