private bool DoMeta(ushort id, string s0, string s1, string s2, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { ulong index = GetCallIndex(); //don't make m_csDB locked across calling SendRequest, which may lead to client dead-lock //in case a client asynchronously sends lots of requests without use of client side queue. lock (m_csDB) { m_mapRowset[index] = new KeyValuePair <DRowsetHeader, DRows>(rh, row); } if (!SendRequest(id, s0, s1, s2, index, (ar) => { ProcessODBC(handler, ar, id, index); }, discarded, null)) { lock (m_csDB) { m_mapRowset.Remove(index); } return(false); } return(true); }
private void ProcessODBC(DExecuteResult handler, CAsyncResult ar, ushort reqId, ulong index) { ulong fail_ok; int res; string errMsg; ar.Load(out res).Load(out errMsg).Load(out fail_ok); COdbc odbc = (COdbc)ar.AsyncServiceHandler; lock (odbc.m_csDB) { odbc.m_lastReqId = reqId; odbc.m_affected = 0; odbc.m_dbErrCode = res; odbc.m_dbErrMsg = errMsg; odbc.m_mapRowset.Remove(index); } if (handler != null) { handler(odbc, res, errMsg, 0, fail_ok, null); } }
private bool DoMeta(ushort id, string s0, string s1, string s2, DExecuteResult handler, DRows row, DRowsetHeader rh) { ulong index; //don't make m_csDB locked across calling SendRequest, which may lead to client dead-lock //in case a client asynchronously sends lots of requests without use of client side queue. lock (m_csDB) { index = ++m_nCall; m_mapRowset[m_nCall] = new KeyValuePair <DRowsetHeader, DRows>(rh, row); } if (!SendRequest(id, s0, s1, s2, index, (ar) => { ulong fail_ok; int res; string errMsg; ar.Load(out res).Load(out errMsg).Load(out fail_ok); lock (m_csDB) { m_lastReqId = id; m_affected = 0; m_dbErrCode = res; m_dbErrMsg = errMsg; m_mapRowset.Remove(m_indexRowset); } if (handler != null) { handler(this, res, errMsg, 0, fail_ok, null); } })) { lock (m_csDB) { m_mapRowset.Remove(index); } return(false); } return(true); }
public bool PrimaryKeys(string CatalogName, string SchemaName, string TableName, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { return(DoMeta(idSQLPrimaryKeys, CatalogName, SchemaName, TableName, handler, row, rh, discarded)); }
public bool ProcedureColumns(string CatalogName, string SchemaName, string ProcName, string ColumnName, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { return(DoMeta(idSQLProcedureColumns, CatalogName, SchemaName, ProcName, ColumnName, handler, row, rh, discarded)); }
public bool Columns(string CatalogName, string SchemaName, string TableName, string ColumnName, DExecuteResult handler, DRows row, DRowsetHeader rh) { return(DoMeta(idSQLColumns, CatalogName, SchemaName, TableName, ColumnName, handler, row, rh, null)); }
public bool ColumnPrivileges(string CatalogName, string SchemaName, string TableName, string ColumnName, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { return(DoMeta(idSQLColumnPrivileges, CatalogName, SchemaName, TableName, ColumnName, handler, row, rh, discarded)); }
public bool ForeignKeys(string PKCatalogName, string PKSchemaName, string PKTableName, string FKCatalogName, string FKSchemaName, string FKTableName, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { return(DoMeta(idSQLForeignKeys, PKCatalogName, PKSchemaName, PKTableName, FKCatalogName, FKSchemaName, FKTableName, handler, row, rh, discarded)); }
public bool Statistics(string CatalogName, string SchemaName, string TableName, ushort unique, ushort reserved, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { ulong index = GetCallIndex(); //don't make m_csDB locked across calling SendRequest, which may lead to client dead-lock //in case a client asynchronously sends lots of requests without use of client side queue. lock (m_csDB) { m_mapRowset[index] = new KeyValuePair <DRowsetHeader, DRows>(rh, row); } if (!SendRequest(idSQLStatistics, CatalogName, SchemaName, TableName, unique, reserved, index, (ar) => { ProcessODBC(handler, ar, idSQLStatistics, index); }, discarded, null)) { lock (m_csDB) { m_mapRowset.Remove(index); } return(false); } return(true); }
public bool Statistics(string CatalogName, string SchemaName, string TableName, ushort unique, ushort reserved, DExecuteResult handler, DRows row, DRowsetHeader rh) { return(Statistics(CatalogName, SchemaName, TableName, unique, reserved, handler, row, rh, null)); }
public bool SpecialColumns(short identifierType, string CatalogName, string SchemaName, string TableName, short scope, short nullable, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { return(DoMeta(idSQLSpecialColumns, identifierType, CatalogName, SchemaName, TableName, scope, nullable, handler, row, rh, discarded)); }
public bool Procedures(string CatalogName, string SchemaName, string ProcName, DExecuteResult handler, DRows row, DRowsetHeader rh) { return(DoMeta(idSQLProcedures, CatalogName, SchemaName, ProcName, handler, row, rh, null)); }
public bool TablePrivileges(string CatalogName, string SchemaName, string TableName, DExecuteResult handler, DRows row, DRowsetHeader rh) { return(DoMeta(idSQLTablePrivileges, CatalogName, SchemaName, TableName, handler, row, rh, null)); }
public bool Statistics(string CatalogName, string SchemaName, string TableName, ushort unique, ushort reserved, DExecuteResult handler, DRows row, DRowsetHeader rh, DDiscarded discarded) { ulong index = GetCallIndex(); //don't make m_csDB locked across calling SendRequest, which may lead to client dead-lock //in case a client asynchronously sends lots of requests without use of client side queue. lock (m_csDB) { m_mapRowset[index] = new KeyValuePair <DRowsetHeader, DRows>(rh, row); } if (!SendRequest(idSQLStatistics, CatalogName, SchemaName, TableName, unique, reserved, index, (ar) => { ulong fail_ok; int res; string errMsg; ar.Load(out res).Load(out errMsg).Load(out fail_ok); lock (m_csDB) { m_lastReqId = idSQLStatistics; m_affected = 0; m_dbErrCode = res; m_dbErrMsg = errMsg; m_mapRowset.Remove(index); } if (handler != null) { handler(this, res, errMsg, 0, fail_ok, null); } }, discarded, null)) { lock (m_csDB) { m_mapRowset.Remove(index); } return(false); } return(true); }
public virtual bool PrimaryKeys(string CatalogName, string SchemaName, string TableName, DExecuteResult handler, DRows row, DRowsetHeader rh) { return(DoMeta(idSQLPrimaryKeys, CatalogName, SchemaName, TableName, handler, row, rh)); }