public void Dispose(bool isDispose) { if (TransStats == 1) { RollbackTrans(); } if (isDispose) { DbConn.Close(); DbConn.Dispose(); Command.Dispose(); DbConn = null; Command = null; } else { if (DbConn != null) { DbConnPool[Key].ReleaseObject(DbConn); } if (Command != null) { DbCommandPool.ReleaseObject(Command); } DbConn = null; Command = null; } }
public NpgSqlExecuteXY() { DbConn = DbConnPool["DefautConnectionString"].GetObject(); if (DbConn == null) { throw new Exception("Sql Connection obj is NULL,Please Look LogOut ERROR Msg!!"); } Key = "DefautConnectionString"; Command = DbCommandPool.GetObject(); Command.Connection = DbConn; }
public NpgSqlExecuteXY(string key) { DbConn = DbConnPool[key].GetObject(); Key = key; if (DbConn == null) { throw new Exception( string.Format("Sql Connection obj is NULL,Please Look LogOut ERROR Msg!! FOR KEY:{0}", key)); } Command = DbCommandPool.GetObject(); Command.Connection = DbConn; }