Ejemplo n.º 1
0
        public ConnectionScope(IConnectionManagerFactory mgr, string constr, IConnectionFactory factory)
        {
            this._conStr       = constr;
            _connectionManager = factory == null?
                                 mgr.GetConnectionManager(constr)
                                     : mgr.GetConnectionManager(factory, constr);

            //this._dbFactory = factory;
        }
Ejemplo n.º 2
0
        public TransScope(IConnectionManagerFactory mgr, IConnectionFactory factory, string connectionString, TransScopeOption option = TransScopeOption.Required)
        {
            _connectionManager = factory == null?
                                 mgr.GetConnectionManager(connectionString)
                                     : mgr.GetConnectionManager(factory, connectionString);

            if (!_connectionManager.IsExistDbTransaction() || option == TransScopeOption.RequiresNew)
            {
                _tran = _connectionManager.BeginTransaction();
                _beginTransactionIsInCurrentTransScope = true;
            }
            else
            {
                _tran = _connectionManager.Transaction;
            }
        }
Ejemplo n.º 3
0
 protected ConnectionManager GetConnection()
 {
     return(_mgr.GetConnectionManager(_dbFactory, this._conStr));
 }