Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQLExtended fetch question / Concurrency
Christian Bruno <brunoc_at_ifrance.com> wrote in message
news:7rlq7r$sja$1_at_minus.oleane.net...
> are you ready for a beginner's question ?
Here is a Intermediate's answer!
> i'm using ODBC in a multi-user context.
>
> the problem :
>
> i select hundreds of records from my database.
> then i do a loop fetching records 10 by 10 until i reach the end of the
> recordset.
>
> if another user updates records that have not yet been fetched by my loop,
> what will i fetch ?
> the values of the records at the moment of the SELECT or the updated
values
> ?
When you use SQLExtendedFetch through an ODBC driver the results will depend on what Micorosoft calls the "Driver Level".
MS distinguishes between different DBMS capabilities using ODBC driver levels. Newer RDBMS's generally have more features than plain, older DBMS's so ODBC drivers are categorized accordingly.
A Level 2 driver is more advanced and is targeted at RDBMS's that have most or all of the features that us modern Desktop DB users expect. Using a Level 2 driver in the above situation would return your 'hundreds of records' into a 'dynaset' type rowset. The dynaset is dynamic and is refreshed automatically in a multiuser environment. So any subsequent calls on the rowset using ODBC will reflect any recent changes.
A Level 1 driver however would return a 'snapshot' type recordset which is just that. A 'picture' is taken of the data and copied into memory as a temporary table which ODBC then uses in subsequent calls to manipulate the data.
As far as I have seen so far, Level 2 ODBC drivers are newer and put out by database companies that are still doing well... i.e. Borland, Informix and Microsoft. In fact, Level 2 drivers are so important to MS, they put out a lot of them in the MDAC package for third party DBMS's. Level 1 ODBC drivers are supported directly by thier own seperate MS DLL (also included in MDAC), are designed to access older DBMS and are generally only available from the DBMS Vendor.
Of course with a Level 2 driver, you can opt to use a snapshot. For
instance, if you did not anticipate a lot of rapid changes to the data then
a snapshot will generally perform faster than an updateable dynaset. The
behavior I described in the above example is the default, but ODBC gives you
a lot of control over how you want to open the data.
>
> thanks again for your help !
No Problem....
Sean
> Regards,
> Christian
>
PS... Forget ODBC.... Go Check Out OLE DB.....;-)
>
Received on Wed Sep 15 1999 - 12:36:04 CDT
![]() |
![]() |