internal override GatewayResult Execute() { Record(); GatewayResult result = new GatewayResult(); GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); Debug.Assert(gatewayAdapterCursor != null); // clear old ranges - might contain old locates. gatewayAdapterCursor.Ranges.Clear(); // TODO 1: // fm_crsr_cache_open ??? // Copy ranges from runtime to gateway if (RuntimeCursor.RuntimeCursorData.Ranges != null) { foreach (RangeData runtimeRange in RuntimeCursor.RuntimeCursorData.Ranges) { RangeData gatewayRange = new RangeData(runtimeRange); RangeConvert(gatewayRange, runtimeRange, gatewayAdapterCursor); gatewayAdapterCursor.Ranges.Add(gatewayRange); } } // TODO 2: // fm_copy_sql_ranges result.ErrorCode = GatewayAdapter.Gateway.CrsrOpen(gatewayAdapterCursor); SetErrorDetails(result); return(result); }
protected void RecordData() { if (DataRecorder != null) { DataRecorder.Record(GatewayAdapter.GetCursor(RuntimeCursor)); } }
internal override GatewayResult Execute() { Record(); GatewayResult result = new GatewayResult(); GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); Debug.Assert(gatewayAdapterCursor != null); gatewayAdapterCursor.Definition.ClearFlag(CursorProperties.DummyFetch); // TODO 1 ???: //if (mg_crsr->blobs) // crsr_fill_blob_info(db_crsr, mg_crsr, dbd->dbh); // TODO 2: for join //link_save_area = fm_link_crsr_buf_save(join_info->db_join_crsr); //retval = SQL_wrap_crsr_fetch_join(join_info->db_join_crsr, // !mg_crsr->fetchSource.is_set(FETCH_BYPASS_TRANS_CACHE)); //fm_link_crsr_buf_restore(join_info->db_join_crsr, link_save_area); // TODO 3: for not join //if (not join) result.ErrorCode = GatewayAdapter.Gateway.CrsrFetch(gatewayAdapterCursor); if (result.Success) { // TODO 4: for dummy fetch // if (db_crsr->properties.is_set (DUMMY_FETCH) && mg_crsr->dummy_fetch_buf != NULL) // TODO 5: check if a record that was fetched is within the ranges // fm_check_rngs // TODO 6: fetch Blobs // CrsrFetchBLOBs & CrsrFetchBLOBsJoin // TODO 7: If not DUMMY_FETCH // fm_flds_mg_4_db ConvertToRuntime(gatewayAdapterCursor); RecordData(); } else // TODO: Error handling. // Temporary !!! if (result.ErrorCode != GatewayErrorCode.NoRecord) { SetErrorDetails(result); } return(result); }
internal override GatewayResult Execute() { Record(); GatewayResult result = new GatewayResult(); GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); if (gatewayAdapterCursor != null) { // TODO: for join cursor CrsrReleaseJoin result.ErrorCode = GatewayAdapter.Gateway.CrsrRelease(gatewayAdapterCursor); GatewayAdapter.RemoveCursor(RuntimeCursor); } SetErrorDetails(result); return(result); }
internal override GatewayResult Execute() { GatewayResult result = new GatewayResult(); Record(); result = CheckIsFlagSet(CursorProperties.Delete); if (result.Success) { GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); Debug.Assert(gatewayAdapterCursor != null); result.ErrorCode = GatewayAdapter.Gateway.CrsrDelete(gatewayAdapterCursor); SetErrorDetails(result); } return(result); }
internal override GatewayResult Execute() { Record(); GatewayResult result = new GatewayResult(); GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); Debug.Assert(gatewayAdapterCursor != null); result.ErrorCode = GatewayAdapter.Gateway.CrsrGetCurr(gatewayAdapterCursor); ConvertToRuntime(gatewayAdapterCursor); RecordData(); SetErrorDetails(result); return(result); }
internal override GatewayResult Execute() { GatewayResult result = new GatewayResult(); Record(); result = CheckIsFlagSet(CursorProperties.Update); if (result.Success) { GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); Debug.Assert(gatewayAdapterCursor != null); // 2. fm_flds_mg_2_db ConvertToGateway(gatewayAdapterCursor); // 3. ///*Update/Delete Stmt chngs copying update fld list from mg_crsr into db_crsr*/??? // 4. update the record into data view //If partofdatetime is set and only time field is updated then before going to gateway set IsFieldUpdated of date field to true. for (int idx = 0; idx < (int)gatewayAdapterCursor.Definition.FieldsDefinition.Count; idx++) { DBField fld = gatewayAdapterCursor.Definition.FieldsDefinition[idx]; if (fld.Storage == FldStorage.TimeString && fld.PartOfDateTime != 0 && gatewayAdapterCursor.Definition.IsFieldUpdated[idx]) { int dateIdx = 0; for (dateIdx = 0; dateIdx < gatewayAdapterCursor.Definition.FieldsDefinition.Count; dateIdx++) { if (DataSourceDefinition.Fields[gatewayAdapterCursor.Definition.FieldsDefinition[dateIdx].IndexInRecord].Isn == fld.PartOfDateTime) { break; } } gatewayAdapterCursor.Definition.IsFieldUpdated[dateIdx] = true; } } result.ErrorCode = GatewayAdapter.Gateway.CrsrUpdate(gatewayAdapterCursor); SetErrorDetails(result); } return(result); }
internal override GatewayResult Execute() { Record(); GatewayResult result = new GatewayResult(); GatewayAdapterCursor gatewayAdapterCursor = GatewayAdapter.GetCursor(RuntimeCursor); Debug.Assert(gatewayAdapterCursor != null); result.ErrorCode = GatewayAdapter.Gateway.CrsrClose(gatewayAdapterCursor); if (result.Success) { // TODO: // Free Blobs } SetErrorDetails(result); return(result); }