RE: Oracle 10g cursor, override CRecordset::Update() problem



Well, not specifically because we're not implementing Bulk Row fetching.

But, the code for RefreshRowset() is :

ASSERT(IsOpen());
ASSERT(m_dwOptions & useMultiRowFetch);

RETCODE nRetCode;

AFX_ODBC_CALL(::SQLSetPos(m_hstmt, wRow, SQL_REFRESH, wLockType));

// Need to fixup bound fields in some cases
if (m_nFields > 0 && !IsEOF() && !IsBOF() &&
!(m_dwOptions & useMultiRowFetch))
{
Fixups();
}

I think the important call here is the SQLSetPos(). If I copy this code and
call it after my Update() call, I get the following output:

Attempt to fetch before the result set returned the first rowset

which I think is interesting. I'm not sure what this is telling me. The
symptoms are the same in that the recordset is still not refreshed.

Any ideas?

Thanks,
--
TC


"Pak-Ming Cheung [MSFT]" wrote:

So, I assumed you are using MFC CRecordset, right?

If so, have you tried CRecordset::RefreshRowset, which can specify which
rows to refresh. This may be less costly than Requery.

Ming.
MDAC Team, Microsoft.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.





"TC" wrote:

We have a data access layer in which polymorphic objects derived from
CRecordset provide a generic interface to both Sybase Adaptive Server and
Oracle databases. This has allowed us to write generic code at the
application level such that the applications do not need to have knowledge of
which database they are pointing at.

In the Oracle case, data gets written using a 3rd party toolkit. The toolkit
is necessary because it maintains some additional integrity and other
functions that are not handled at the server side.

To make this work, we have overridden CRecordset::Update() and taken care of
edits and inserts by calling the toolkit from inside the method, thereby
circumventing the base implementation.

This has worked fine, until we recently began to work on supporting Orcacle
10g.

What we see is that in the edit case, the edit is made to the data store
correctly, but for some reason, when we move through the recordset
(CRecordset::Move()),
the underlying cursor does not reflect the edit. Rather, it still seems to
contain the original values.

Several of our apps are CRecordView based, and advancing through result set
and seeing old values is obviously a problem. We can execute a Requery() on
the CRecordset object, which does then refresh the edited record, but this is
unacceptable for performance reasons.

The CRecordsets derived classes are being opened as dynasets, but in a way
seem to be behaving more like snapshots.

Has anyone seen similar behavior, or have any suggestions about what might
be wrong and how to go about fixing it?

Thanks,

--
TC
.



Relevant Pages

  • RE: Oracle 10g cursor, override CRecordset::Update() problem
    ... So, I assumed you are using MFC CRecordset, right? ... data gets written using a 3rd party toolkit. ... What we see is that in the edit case, the edit is made to the data store ... the CRecordset object, which does then refresh the edited record, but this is ...
    (microsoft.public.data.odbc)
  • Re: refresh gridview at postback
    ... I am seeking a solution where 'delete' and 'edit' will work. ... without invoking databind, then 'delete' correctly removes ... However then 'edit' fails to refresh the gridview. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: View a WinWord Doc in a WinForm
    ... edit it as well. ... First, the time it takes to load (or refresh if the> doc changes); second, the WinWord document view is whatever the user has set> (ex. ... > On the new Active Document Host Control, will we be able to minipulate the> hosted document or is it view only? ... I cannot convert it to RTF because I have> drawn ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Edit and continue in VS2005
    ... "Edit & Refresh" is supported. ... implement that client app E&C. ... code on remote server is a major security violation. ...
    (microsoft.public.vsnet.general)
  • Re: Could anyone please confirm this?
    ... > when you edit one of the items the list won't update, ... tell the ListModel to refresh the disiplay for that item that was edited. ... "Make a change that requires a display update." ...
    (comp.lang.smalltalk.dolphin)

Loading