//function to execute SELECT * query wyInt32 TableView::ExecuteTableData() { wyString query; wyInt32 ret; MySQLDataEx* pdata; query.Sprintf("select * from `%s`.`%s`", m_mydata->m_db.GetString(), m_mydata->m_table.GetString()); //get filter info GetFilterInfo(query); //get sort info GetSortInfo(query); //get limits GetLimits(query); //execut query m_mydata->m_datares = ExecuteQuery(query); //is thread stopped if(ThreadStopStatus()) { return TE_STOPPED; } //any error? show error dialog if(!m_mydata->m_datares) { return HandleErrors(query); } //allocate row array, if the thread is stopped, delete them if((ret = AllocateRowsExArray()) != TE_SUCCESS || (ret = GetTableDetails()) != TE_SUCCESS) { pdata = ResetData(m_data); delete pdata; return ret; } //add new row in the end AddNewRow(); return TE_SUCCESS; }
static HRESULT GetSplitter(MediaDetImpl *This) { IFileSourceFilter *file; LPOLESTR name; AM_MEDIA_TYPE mt; GUID type[2]; IFilterMapper2 *map; IEnumMoniker *filters; IMoniker *mon; VARIANT var; GUID clsid; IBaseFilter *splitter; IEnumPins *pins; IPin *source_pin, *splitter_pin; HRESULT hr; hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (void **) &map); if (FAILED(hr)) return hr; hr = IBaseFilter_QueryInterface(This->source, &IID_IFileSourceFilter, (void **) &file); if (FAILED(hr)) { IFilterMapper2_Release(map); return hr; } hr = IFileSourceFilter_GetCurFile(file, &name, &mt); IFileSourceFilter_Release(file); CoTaskMemFree(name); if (FAILED(hr)) { IFilterMapper2_Release(map); return hr; } type[0] = mt.majortype; type[1] = mt.subtype; CoTaskMemFree(mt.pbFormat); hr = IFilterMapper2_EnumMatchingFilters(map, &filters, 0, TRUE, MERIT_UNLIKELY, FALSE, 1, type, NULL, NULL, FALSE, TRUE, 0, NULL, NULL, NULL); IFilterMapper2_Release(map); if (FAILED(hr)) return hr; hr = E_NOINTERFACE; while (IEnumMoniker_Next(filters, 1, &mon, NULL) == S_OK) { hr = GetFilterInfo(mon, &clsid, &var); IMoniker_Release(mon); if (FAILED(hr)) continue; hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (void **) &splitter); if (FAILED(hr)) { VariantClear(&var); continue; } hr = IGraphBuilder_AddFilter(This->graph, splitter, V_UNION(&var, bstrVal)); VariantClear(&var); This->splitter = splitter; if (FAILED(hr)) goto retry; hr = IBaseFilter_EnumPins(This->source, &pins); if (FAILED(hr)) goto retry; IEnumPins_Next(pins, 1, &source_pin, NULL); IEnumPins_Release(pins); hr = IBaseFilter_EnumPins(splitter, &pins); if (FAILED(hr)) { IPin_Release(source_pin); goto retry; } IEnumPins_Next(pins, 1, &splitter_pin, NULL); IEnumPins_Release(pins); hr = IPin_Connect(source_pin, splitter_pin, NULL); IPin_Release(source_pin); IPin_Release(splitter_pin); if (SUCCEEDED(hr)) break; retry: IBaseFilter_Release(splitter); This->splitter = NULL; } IEnumMoniker_Release(filters); if (FAILED(hr)) return hr; return S_OK; }
void CGenPropertyPage::LoadList (void) { long iCount = 0; long iNotShown = 0; // for filtering CScriptEngine * m_ScriptEngine = NULL; // for the filtering checks bool bFiltering = GetFilterFlag (); if (bFiltering) { m_ScriptEngine = new CScriptEngine (m_doc, "Lua"); if (m_ScriptEngine->CreateScriptEngine ()) bFiltering = false; else { // compile filter script try { if (m_ScriptEngine->Parse (GetFilterScript (), "Script file")) bFiltering = false; } // end of try catch (CException * e) { e->ReportError (); e->Delete (); bFiltering = false; } } // not error creating engine } // end of filtering wanted lua_State * L = NULL; // if filtering, get the "filter" function on the stack if (bFiltering) { L = m_ScriptEngine->L; // make copy for convenience lua_settop(L, 0); // clear stack, just in case if (!GetNestedFunction (L, "filter", true)) bFiltering = false; } // remove all old items (we used the item data to key to the item) for (int nItem = 0; nItem < m_ctlList->GetItemCount (); nItem++) delete (CString *) m_ctlList->GetItemData (nItem); m_ctlList->DeleteAllItems (); CString strObjectName; CObject * pItem; // Item data for (POSITION pos = m_ObjectMap->GetStartPosition (); pos; ) { m_ObjectMap->GetNextAssoc (pos, strObjectName, pItem); bool bUse = true; // defaults to true if no filtering if (bFiltering) { lua_pushvalue(L, 1); // filter function lua_pushstring (L, (const char *) strObjectName); // key of the item GetFilterInfo (pItem, L); // table of related info if (lua_pcall (L, 2, 1, 0)) // call with 1 arg1 and 1 result { LuaError (L); bFiltering = false; } else { // use result if we get the exact type: boolean (true/false) if (lua_isboolean (L, -1)) { bUse = lua_toboolean (L, -1); if (!bUse) iNotShown++; // this one not shown } lua_pop (L, 1); // pop result } } // end of filtering wanted if (bUse) // add to list if passed filter { CString * pstrObjectName = new CString (strObjectName); add_item (pItem, pstrObjectName, 0, TRUE); iCount++; } } t_gen_sort_param sort_param (m_ObjectMap, m_last_col, m_reverse, m_CompareObjects); m_ctlList->SortItems (CompareFunc, (LPARAM) &sort_param); // set the 1st item to be selected - we do this here because sorting the // list means our first item is not necessarily the 1st item in the list if (!m_ObjectMap->IsEmpty ()) // provided we have any m_ctlList->SetItemState (0, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED); CString strSummary = TFormat ("%i item%s.", PLURAL (iCount)); if (iNotShown) strSummary += TFormat (" (%i item%s hidden by filter)", PLURAL (iNotShown)); m_ctlSummary->SetWindowText (strSummary); delete m_ScriptEngine; } // end of CGenPropertyPage::LoadList
FilterChain *FilterManager::LoadFilters(QString Filters, VideoFrameType &inpixfmt, VideoFrameType &outpixfmt, int &width, int &height, int &bufsize, int max_threads) { if (Filters.toLower() == "none") return nullptr; vector<const FilterInfo*> FiltInfoChain; FilterChain *FiltChain = new FilterChain; vector<FmtConv*> FmtList; const FilterInfo *FI; const FilterInfo *FI2; QString Opts; const FilterInfo *Convert = GetFilterInfo("convert"); QStringList OptsList; QStringList FilterList = Filters.split(",", QString::SkipEmptyParts); VideoFilter *NewFilt = nullptr; FmtConv *FC, *FC2, *S1, *S2, *S3; VideoFrameType ifmt; int nbufsize; int cbufsize; int postfilt_width = width; int postfilt_height = height; for (auto i = FilterList.begin(); i != FilterList.end(); ++i) { QString FiltName = (*i).section('=', 0, 0); QString FiltOpts = (*i).section('=', 1); if (FiltName.contains("opengl", Qt::CaseInsensitive) || FiltName.contains("vdpau", Qt::CaseInsensitive)) continue; FI = GetFilterInfo(FiltName); if (FI) { FiltInfoChain.push_back(FI); OptsList.push_back(FiltOpts); } else { LOG(VB_GENERAL, LOG_ERR, LOC + QString("Failed to load filter '%1', " "no such filter exists").arg(FiltName)); FiltInfoChain.clear(); break; } } ifmt = inpixfmt; for (uint i = 0; i < FiltInfoChain.size(); i++) { S1 = S2 = S3 = nullptr; FI = FiltInfoChain[i]; if (FiltInfoChain.size() - i == 1) { for (FC = FI->formats; FC->in != FMT_NONE; FC++) { if (FC->out == outpixfmt && FC->in == ifmt) { S1 = FC; break; } if (FC->in == ifmt && !S2) S2 = FC; if (FC->out == outpixfmt && !S3) S3 = FC; } } else { FI2 = FiltInfoChain[i+1]; for (FC = FI->formats; FC->in != FMT_NONE; FC++) { for (FC2 = FI2->formats; FC2->in != FMT_NONE; FC2++) { if (FC->in == ifmt && FC->out == FC2->in) { S1 = FC; break; } if (FC->out == FC2->in && !S3) S3 = FC; } if (S1) break; if (FC->in == ifmt && !S2) S2 = FC; } } if (S1) FC = S1; else if (S2) FC = S2; else if (S3) FC = S3; else FC = FI->formats; if (FC->in != ifmt && (i > 0 || ifmt != FMT_NONE)) { if (!Convert) { LOG(VB_GENERAL, LOG_ERR, "FilterManager: format conversion " "needed but convert filter not found"); FiltInfoChain.clear(); break; } FiltInfoChain.insert(FiltInfoChain.begin() + i, Convert); OptsList.insert(i, QString ()); FmtList.push_back(new FmtConv); if (FmtList.back()) { FmtList.back()->in = ifmt; FmtList.back()->out = FC->in; i++; } else { LOG(VB_GENERAL, LOG_ERR, "FilterManager: memory allocation " "failure, returning empty filter chain"); FiltInfoChain.clear(); break; } } FmtList.push_back(new FmtConv); if (FmtList.back()) { FmtList.back()->in = FC->in; FmtList.back()->out = FC->out; } else { LOG(VB_GENERAL, LOG_ERR, "FilterManager: memory allocation failure, " "returning empty filter chain"); FiltInfoChain.clear(); break; } ifmt = FC->out; } if (ifmt != outpixfmt && outpixfmt != FMT_NONE && (FiltInfoChain.size() || inpixfmt != FMT_NONE)) { if (!Convert) { LOG(VB_GENERAL, LOG_ERR, "FilterManager: format conversion " "needed but convert filter not found"); FiltInfoChain.clear(); } else { FiltInfoChain.push_back(Convert); OptsList.push_back( QString ()); FmtList.push_back(new FmtConv); if (FmtList.back()) { FmtList.back()->in = ifmt; FmtList.back()->out = outpixfmt; } else { LOG(VB_GENERAL, LOG_ERR, "FilterManager: memory allocation " "failure, returning empty filter chain"); FiltInfoChain.clear(); } } } nbufsize = -1; if (FiltInfoChain.empty()) { delete FiltChain; FiltChain = nullptr; } for (uint i = 0; i < FiltInfoChain.size(); i++) { QByteArray tmp = OptsList[i].toLocal8Bit(); NewFilt = LoadFilter(FiltInfoChain[i], FmtList[i]->in, FmtList[i]->out, postfilt_width, postfilt_height, tmp.constData(), max_threads); if (!NewFilt) { delete FiltChain; LOG(VB_GENERAL, LOG_ERR, QString("FilterManager: failed to load " "filter %1 %2->%3 with args %4") .arg(FiltInfoChain[i]->name) .arg(FmtToString(FmtList[i]->in)) .arg(FmtToString(FmtList[i]->out)) .arg(OptsList[i])); FiltChain = nullptr; nbufsize = -1; break; } if (NewFilt->filter && FiltChain) { FiltChain->Append(NewFilt); } else { if (NewFilt->opts) free(NewFilt->opts); if (NewFilt->cleanup) NewFilt->cleanup(NewFilt); dlclose(NewFilt->handle); free(NewFilt); } switch (FmtList[i]->out) { case FMT_YV12: cbufsize = postfilt_width * postfilt_height * 3 / 2; break; case FMT_YUV422P: cbufsize = postfilt_width * postfilt_height * 2; break; case FMT_RGB24: cbufsize = postfilt_width * postfilt_height * 3; break; case FMT_ARGB32: cbufsize = postfilt_width * postfilt_height * 4; break; default: cbufsize = 0; } if (cbufsize > nbufsize) nbufsize = cbufsize; } if (FiltChain) { if (inpixfmt == FMT_NONE) inpixfmt = FmtList.front()->in; if (outpixfmt == FMT_NONE) outpixfmt = FmtList.back()->out; width = postfilt_width; height = postfilt_height; } else { if (inpixfmt == FMT_NONE && outpixfmt == FMT_NONE) inpixfmt = outpixfmt = FMT_YV12; else if (inpixfmt == FMT_NONE) inpixfmt = outpixfmt; else if (outpixfmt == FMT_NONE) outpixfmt = inpixfmt; } switch (inpixfmt) { case FMT_YV12: cbufsize = postfilt_width * postfilt_height * 3 / 2; break; case FMT_YUV422P: cbufsize = postfilt_width * postfilt_height * 2; break; case FMT_RGB24: cbufsize = postfilt_width * postfilt_height * 3; break; case FMT_ARGB32: cbufsize = postfilt_width * postfilt_height * 4; break; default: cbufsize = 0; } if (cbufsize > nbufsize) nbufsize = cbufsize; bufsize = nbufsize; vector<FmtConv*>::iterator it = FmtList.begin(); for (; it != FmtList.end(); ++it) delete *it; FmtList.clear(); return FiltChain; }
//function to execute SELECT * query wyInt32 TableView::ExecuteTableData() { wyString query; wyInt32 ret,extraindex,j=0,no_row; MySQLDataEx* pdata; MYSQL_ROW fieldrow; query.Sprintf("select * from `%s`.`%s`", m_mydata->m_db.GetString(), m_mydata->m_table.GetString()); //get filter info GetFilterInfo(query); //get sort info GetSortInfo(query); //get limits GetLimits(query); //execut query m_mydata->m_datares = ExecuteQuery(query); //is thread stopped if(ThreadStopStatus()) { return TE_STOPPED; } //any error? show error dialog if(!m_mydata->m_datares) { return HandleErrors(query); } //allocate row array, if the thread is stopped, delete them if((ret = AllocateRowsExArray()) != TE_SUCCESS || (ret = GetTableDetails()) != TE_SUCCESS) { pdata = ResetData(m_data); delete pdata; return ret; } extraindex = GetFieldIndex(m_wnd->m_tunnel, m_data->m_fieldres, "Extra"); no_row = m_wnd->m_tunnel->mysql_num_rows(m_data->m_fieldres); m_data->m_colvirtual = (wyInt32*)calloc(no_row, sizeof(wyInt32)); while(fieldrow = m_wnd->m_tunnel->mysql_fetch_row(m_data->m_fieldres)){ if(!strstr(fieldrow[extraindex], "VIRTUAL") && !strstr(fieldrow[extraindex], "PERSISTENT") && !strstr(fieldrow[extraindex], "STORED")) { m_data->m_colvirtual[j++] = 0; } else { m_data->m_colvirtual[j++] = 1; } } //add new row in the end AddNewRow(); return TE_SUCCESS; }
/// <summary>Executes the release lock command, returning an FdoILockConflictReader.</summary> /// <returns>Returns an FdoILockConflictReader</returns> FdoILockConflictReader* ArcSDEReleaseLockCommand::Execute () { const CHAR* columns[1]; FdoPtr<ArcSDEConnection> connection; CHAR table[SE_QUALIFIED_TABLE_NAME]; CHAR column[SE_MAX_COLUMN_LEN]; wchar_t* wcolumn; CHAR *where; SHORT count; SE_FILTER* filters; FdoString* property; LONG result; SE_STREAM stream; CHAR user_name[SE_MAX_OWNER_LEN]; wchar_t* me; CHAR logfile[SE_MAX_PATH_LEN]; SE_SQL_CONSTRUCT sql_construct; CHAR* tables[1]; FdoPtr<FdoISQLDataReader> reader; SE_LOG log; LONG number = 0; Lock* locks = NULL; wchar_t* locktable = NULL; FdoPtr<ArcSDELockConflictReader> ret; // verify the connection connection = static_cast<ArcSDEConnection*>(GetConnection ()); if (connection == NULL) throw FdoException::Create (NlsMsgGet (ARCSDE_CONNECTION_NOT_ESTABLISHED, "Connection not established.")); // verify the feature class name is specified if (mClassName == NULL) throw FdoException::Create (NlsMsgGet (ARCSDE_FEATURE_CLASS_UNSPECIFIED, "Feature class name not specified.")); // get the class definition which reflects the requested feature class name FdoPtr<FdoClassDefinition> definition = connection->GetRequestedClassDefinition (mClassName); // get the filter if any FdoPtr<FdoFilter> filter = GetFilter (); // get SQL query's "from" table list mConnection->ClassToTable (table, definition); // ensure lockable table if (!ArcSDELockUtility::IsLockable (connection->GetConnection (), table, column)) { wchar_t* wtable; sde_multibyte_to_wide (wtable, table); throw FdoException::Create (NlsMsgGet1 (ARCSDE_LOCKING_NOT_ENABLED, "Table '%1$ls' is not lock enabled.", wtable)); } // get the property name that is the row_id sde_multibyte_to_wide (wcolumn, column); property = connection->ColumnToProperty (definition, wcolumn); // get SQL query's "where" clause & spatial filters where = NULL; count = 0; filters = NULL; GetFilterInfo (connection, filter, definition, where, count, filters); // establish an empty conflict reader ret = new ArcSDELockConflictReader (connection, definition->GetQualifiedName (), table, property); // initialize the stream query result = SE_stream_create (connection->GetConnection (), &stream); handle_sde_err<FdoCommandException> (connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_STREAM_ALLOC, "Cannot initialize SE_STREAM structure."); // if necessary, version enable the stream ArcSDELongTransactionUtility::VersionStream (connection, stream, table, false); // release lock, don't return rows result = SE_connection_get_user_name (connection->GetConnection (), user_name); handle_sde_err<FdoCommandException> (connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_USER_UNKNOWN, "Cannot determine current user."); sde_multibyte_to_wide (me, user_name); if (0 == wcscmp (GetLockOwner (), L"")) { result = SE_stream_set_rowlocking (stream, SE_ROWLOCKING_UNLOCK_ON_QUERY | SE_ROWLOCKING_LOCK_ONLY); handle_sde_err<FdoCommandException> (connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_STREAM_LOCK, "Cannot set row locking on the stream."); } else if (0 == wcscmp (GetLockOwner (), me)) { result = SE_stream_set_rowlocking (stream, SE_ROWLOCKING_UNLOCK_ON_QUERY | SE_ROWLOCKING_FILTER_MY_LOCKS | SE_ROWLOCKING_LOCK_ONLY); handle_sde_err<FdoCommandException> (connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_STREAM_LOCK, "Cannot set row locking on the stream."); } else { LONG *ids = NULL; CHAR **users = NULL; CHAR lt[SE_QUALIFIED_TABLE_NAME]; if (0) throw FdoCommandException::Create (NlsMsgGet (ARCSDE_RELEASE_UNOWNED_LOCKS, "Releasing other owners locks is not supported.")); result = SE_table_get_rowlocks (connection->GetConnection(), table, &number, &ids, &users); handle_sde_err<FdoCommandException>(connection->GetConnection(), result, __FILE__, __LINE__, ARCSDE_GET_ROW_LOCK_LIST_FAILED, "Failed to get the row lock list."); if (0 != number) { // put the id's and users in an array of lock structures locks = (Lock*)calloc (number, sizeof (Lock)); for (int i = 0; i < number; i++) { locks[i].id = ids[i]; sde_strcpy (sde_pus2wc(locks[i].user), sde_pcus2wc(users[i])); } qsort (locks, number, sizeof (LONG), compare); ArcSDELockUtility::LockTableName (lt, connection, table); sde_multibyte_to_wide (locktable, lt); SE_table_free_rowlocks_list (number, ids, users); } } // apply attribute and spatial query to stream columns[0] = column; ApplyFilterInfoToStream (connection, stream, table, where, 1, columns, count, filters); // set up a temporary log file mConnection->MakeLog (&log, table); // accumulate the query in the log file result = SE_stream_set_logfile (stream, log, FALSE); handle_sde_err<FdoCommandException> (stream, result, __FILE__, __LINE__, ARCSDE_LOG_SET_LOGFILE, "Could not set log file."); // lock the table's lock table to prevent alteration reader = ArcSDELockUtility::LockLockTable (mConnection, table); // actually execute the query result = SE_stream_execute (stream); handle_sde_err<FdoCommandException>(stream, result, __FILE__, __LINE__, ARCSDE_STREAM_EXECUTE, "Stream execute failed."); result = SE_stream_fetch (stream); // three possibilities: locks for the specified user exist (SE_SUCCESS) and the log file isn't filled, // everything was unlocked (SE_FINISHED) // or there was a conflict (SE_LOCK_CONFLICT) switch (result) { case SE_SUCCESS: if (0 != number) { CHAR* user; LONG id; wchar_t drop[1024]; FdoPtr<FdoISQLCommand> sql; Lock key; Lock* item; // Get lock owner name: const wchar_t *wLockOwner = GetLockOwner(); wchar_t *wLockOwnerUpr = (wchar_t*)alloca( (1+wcslen(wLockOwner)) * sizeof(wchar_t)); wcscpy(wLockOwnerUpr, wLockOwner); FdoCommonOSUtil::wcsupr(wLockOwnerUpr); // ToDo: Oracle-specific sde_wide_to_multibyte (user, wLockOwnerUpr); // process each row returned (ignoring the log file) sql = (FdoISQLCommand*)connection->CreateCommand (FdoCommandType_SQLCommand); do { if (SE_SUCCESS != (result = SE_stream_get_integer (stream, 1, &id))) { sde_multibyte_to_wide (wcolumn, column); handle_sde_err<FdoCommandException> (stream, result, __FILE__, __LINE__, ARCSDE_STREAM_GET, "Stream get ('%1$ls') failed for column '%2$ls'.", L"SE_stream_get_integer", wcolumn); } else { key.id = id; // look it up to see if it's a conflict (i.e. not found) if (NULL != (item = (Lock*)bsearch (&key, locks, number, sizeof (LONG), compare))) { if (0 == sde_strcmp (sde_pcus2wc(user), sde_pcus2wc(item->user))) { // ToDo: optimize this singleton delete somewhat //ROW_ID NOT NULL NUMBER(38) //USER_NAME NOT NULL VARCHAR2(32) FdoCommonOSUtil::swprintf (drop, ELEMENTS (drop), L"delete from %ls where user_name=upper('%ls') and row_id = %ld", locktable, GetLockOwner (), id); sql->SetSQLStatement (drop); sql->ExecuteNonQuery (); } else ret->AddIdentity (id); } else { // no lock, hence no conflict } } } while (SE_SUCCESS == (result = SE_stream_fetch (stream))); if (SE_FINISHED != result) handle_sde_err<FdoCommandException> (stream, result, __FILE__, __LINE__, ARCSDE_STREAM_FETCH, "Stream fetch failed."); } break; case SE_FINISHED: break; case SE_LOCK_CONFLICT: // reuse the same stream result = SE_stream_close (stream, TRUE); // if necessary, version enable the stream ArcSDELongTransactionUtility::VersionStream (connection, stream, table, false); // select locks still remaining result = SE_stream_set_rowlocking (stream, SE_ROWLOCKING_FILTER_OTHER_LOCKS); handle_sde_err<FdoCommandException> (connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_STREAM_LOCK, "Cannot set row locking on the stream."); // get the list of row ids from the log file tables[0] = table; sql_construct.tables = tables; sql_construct.num_tables = ELEMENTS (tables); sql_construct.where = NULL; ArcSDELockUtility::GetLogFile (logfile, connection->GetConnection (), log); result = SE_stream_query_logfile (stream, logfile, 1, columns, &sql_construct); handle_sde_err<FdoCommandException>(stream, result, __FILE__, __LINE__, ARCSDE_LOG_FILE_QUERY, "Unable to query log file."); // execute the query that fetches conflicts result = SE_stream_execute (stream); handle_sde_err<FdoCommandException>(stream, result, __FILE__, __LINE__, ARCSDE_STREAM_EXECUTE, "Stream execute failed."); // gather the conflicts ArcSDELockUtility::GatherConflicts (stream, column, 1, ret); // if there were conflicts (and there will be), do a partial unlock if (0 != ret->mIds->GetCount ()) { // reuse the same stream result = SE_stream_close (stream, TRUE); // if necessary, version enable the stream ArcSDELongTransactionUtility::VersionStream (connection, stream, table, false); // select locks still remaining result = SE_stream_set_rowlocking (stream, SE_ROWLOCKING_FILTER_MY_LOCKS | SE_ROWLOCKING_UNLOCK_ON_QUERY | SE_ROWLOCKING_LOCK_ONLY); handle_sde_err<FdoCommandException> (connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_STREAM_LOCK, "Cannot set row locking on the stream."); // get the list of row ids from the log file result = SE_stream_query_logfile (stream, logfile, 1, columns, &sql_construct); handle_sde_err<FdoCommandException>(stream, result, __FILE__, __LINE__, ARCSDE_LOG_FILE_QUERY, "Unable to query log file."); // execute the query that unlocks rows result = SE_stream_execute (stream); handle_sde_err<FdoCommandException>(stream, result, __FILE__, __LINE__, ARCSDE_STREAM_EXECUTE, "Stream execute failed."); } else throw FdoException::Create (NlsMsgGet(ARCSDE_UNEXPECTED_ERROR, "Unexpected error encountered in ArcSDE Provider.")); break; default: handle_sde_err<FdoCommandException> (stream, result, __FILE__, __LINE__, ARCSDE_STREAM_FETCH, "Stream fetch failed."); } // release the transaction lock if (reader != NULL) reader->Close (); // clean up if (NULL != locks) free(locks); result = SE_stream_free (stream); handle_sde_err<FdoCommandException>(connection->GetConnection (), result, __FILE__, __LINE__, ARCSDE_STREAM_FREE, "Stream free failed."); delete[] where; if (NULL != filters) { for (int i = 0; i < count; i++) if (NULL != filters[i].filter.shape) SE_shape_free (filters[i].filter.shape); delete[] filters; } return (FDO_SAFE_ADDREF (ret.p)); }