public virtual IDb OpenDb(IDbConnection cn) { OrlDb db = new OrlDb(this, cn); db.IsAdapter = true; return(db); }
public virtual IDb OpenDb() { IDbConnection cn = new Oracle.DataAccess.Client.OracleConnection(connString); //cn.Open(); IDb db = new OrlDb(this, cn); return(db); }
public virtual void CloseDb(OrlDb db) { if (!db.IsClosed) { if (!db.IsAdapter && db.Connection != null) { Oracle.DataAccess.Client.OracleConnection cn = (Oracle.DataAccess.Client.OracleConnection)db.Connection; if (cn.State != ConnectionState.Closed) { cn.Close(); } cn.Dispose(); db.Connection = null; } } }
public virtual void OpenDb(OrlDb db) { if (db.IsClosed) { if (db.Connection == null) { db.Connection = new Oracle.DataAccess.Client.OracleConnection(connString); db.Connection.Open(); } else { if (db.Connection.State == ConnectionState.Closed) { db.Connection.Open(); } } } }