public IDbTransaction CreateTransaction(string connectionName, string connectionString)
        {
            try {
                if (!String.IsNullOrEmpty(connectionName))
                {
                    IDatabaseServices databaseServices = AdaptersUtils.GetDatabaseServices(GetDatabaseKind(connectionName),
                                                                                           new ConnectionString(connectionString));

                    ITransactionManager baseTransactionManager = GetProviderFromConnectionNameOrMain(connectionName).TransactionManager;
                    ITransactionService transactionService     = databaseServices.TransactionService;

                    IDbConnection connection = transactionService.CreateConnection();

                    return(ADOAdaptersUtils.AdapterTransaction(transactionService.CreateTransaction(connection)));
                }
                else
                {
                    return(CreateTransaction(connectionString));
                }
            } catch (ConnectionNotFoundException e) {
                throw new DBConnectionNotFoundException(e.Message);
            } catch (InvalidDatabaseAccessException e) {
                throw new InvalidDBTransactionManagerAccess(e.Message);
            } catch (InvalidTransactionReleaseException e) {
                throw new InvalidReleaseException(e.Message);
            }
        }
 public virtual IDbTransaction GetPrivateTransaction()
 {
     try {
         return(ADOAdaptersUtils.AdapterTransaction(DBAccess.MainProvider.GetCommitableTransaction().DriverTransaction));
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     }
 }
Exemplo n.º 3
0
 public IDbTransaction GetReadOnlyTransaction()
 {
     try {
         return(ADOAdaptersUtils.AdapterTransaction(TransactionManager.GetReadOnlyTransaction()));
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     }
 }
Exemplo n.º 4
0
 public IDbTransaction CreateTransaction(ConnectionString connectionString)
 {
     try {
         IDatabaseServices databaseServices = AdaptersUtils.GetDatabaseServices(DatabaseKind, connectionString);
         return(ADOAdaptersUtils.AdapterTransaction(databaseServices.TransactionService.CreateTransaction(GetConnection(connectionString))));
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     }
 }
 public IDbTransaction GetPrivateTransaction(string connectionName)
 {
     try {
         return(ADOAdaptersUtils.AdapterTransaction(GetProviderFromConnectionNameOrMain(connectionName).TransactionManager.GetCommitableTransaction()));
     } catch (ConnectionNotFoundException e) {
         throw new DBConnectionNotFoundException(e.Message);
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     } catch (InvalidTransactionReleaseException e) {
         throw new InvalidReleaseException(e.Message);
     }
 }
        public bool isConnectedUser(string userName)
        {
            try {
                using (Transaction requestTransaction = DBAccess.MainProvider.GetRequestTransaction()) {
                    // ReSharper disable once JoinDeclarationAndInitializer

                    IDbTransaction trans;
                    trans = ADOAdaptersUtils.AdapterTransaction(requestTransaction.DriverTransaction);
                    return(isConnectedUser(trans, userName));
                }
            } catch (InvalidDatabaseAccessException e) {
                throw new InvalidDBTransactionManagerAccess(e.Message);
            }
        }