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 IDbConnection GetConnection(DBKind dbKind, ConnectionString connectionString, string schema)
 {
     try {
         return(AdaptersUtils.GetDatabaseServices(dbKind, connectionString, schema).TransactionService.CreateConnection());
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     }
 }
 public IDbConnection CreateConnection(ConnectionString connectionString)
 {
     try {
         string schema = DBAccess.SystemProvider.DatabaseServices.DatabaseConfiguration.DatabaseIdentifier;
         return(AdaptersUtils.GetDatabaseServices(DBKind, connectionString, schema).TransactionService.CreateConnection());
     } catch (InvalidDatabaseAccessException e) {
         throw new InvalidDBTransactionManagerAccess(e.Message);
     }
 }
Пример #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 ConnectionString GetConnectionStringObject(string connectionName)
 {
     try {
         return(AdaptersUtils.GetConnectionString(
                    GetProviderFromConnectionNameOrMain(connectionName).DatabaseServices));
     } 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 IDbConnection GetConnection(string connectionName, string connectionString)
        {
            try {
                IDatabaseServices databaseServices = AdaptersUtils.GetDatabaseServices(GetDatabaseKind(connectionName),
                                                                                       new ConnectionString(connectionString));

                return(databaseServices.TransactionService.CreateConnection());
            } 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 OracleConnectionManager(DBKind dbKind, ConnectionString connectionString, string schema, int retries)
     : base(AdaptersUtils.GetDatabaseServices(dbKind, connectionString, schema).TransactionService.CreateTransactionManager())
 {
 }