SELECT...FOR UPDATE under ATL OLEDB 
Author Message
 SELECT...FOR UPDATE under ATL OLEDB

I use ATL generated OLEDB consumer to connect to an Oracle database.  I
have to support cocurrent access from multiple users.  I have a Long
Raw column under my table.  Oracle requires us to call SELECT...FOR
UPDATE statment to do row level locking when reading this column.  I
wonder how to use it properly in my OLEDB consumer code.  I use
StartTransaction() of CSession to start a transaction and then
construct the "SELECT ... FOR UPDATE" as SQL under CCommand.  I get an
error saying only one transaction can be running at a time.

Has anybody tried similar thing before.  What would be the correct
syntax to make SELECT...FOR UPDATE works in a similar mannar as
SELECT ... FROM theTable WITH(UPDLOCK) in SQL Server.

Thanks,

DP

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 25 Aug 2002 03:00:00 GMT  
 SELECT...FOR UPDATE under ATL OLEDB
I notice that the UPDLOCK hint can be replaced by the ODBC call of
SQLSETSTMTOPTION (...,SQL_CONCURRENCY)= SQL_CONCUR_LOCK.  They should
have similar effect.  My next question would be how to implement that
under OLEDB consumer?


Quote:

> I use ATL generated OLEDB consumer to connect to an Oracle database.
I
> have to support cocurrent access from multiple users.  I have a Long
> Raw column under my table.  Oracle requires us to call SELECT...FOR
> UPDATE statment to do row level locking when reading this column.  I
> wonder how to use it properly in my OLEDB consumer code.  I use
> StartTransaction() of CSession to start a transaction and then
> construct the "SELECT ... FOR UPDATE" as SQL under CCommand.  I get an
> error saying only one transaction can be running at a time.

> Has anybody tried similar thing before.  What would be the correct
> syntax to make SELECT...FOR UPDATE works in a similar mannar as
> SELECT ... FROM theTable WITH(UPDLOCK) in SQL Server.

> Thanks,

> DP

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 26 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. No tables to select from when selecting SQL OLEDB provider

2. ADO vs OLEDB COM vs OLEDB ATL templates

3. Select * and OLEDB on Oracle?

4. Any updates in ATL/ATL Server in VC 7.1

5. Update (OLEDB) not writing changes in DB

6. OleDb update & DataGrid

7. weird problem with Update Access database using OleDb.

8. OLEDB Provider ATL from VS6 -> dotnet

9. ATL OLEDB Consumer using attributes

10. ATL, MFC, OLEDB... vc7

11. ATL and OLEDB Samples for SQL Server

12. OLEDB ATL Consumer using VC 6.0

 

 
Powered by phpBB® Forum Software