Re: OLE DB Cursors
- From: "Bob Beauchemin" <no_bobb_spam@xxxxxxxxxxxxx>
- Date: Mon, 17 Oct 2005 15:01:24 -0700
Hi Linz,
You don't do this with properties in the SQL Server OLE DB provider. In
order to lock rows while you're updating (NOT a good idea for performance,
be warned), you need to begin a transaction at the Repeatable Read isolation
level or above (repeat, NOT a good idea). There are some properties that
refer to whether or not you can "see" updates made inside a rowset, but
that's orthorgonal to locking. In addition, there is are a few "misleading"
properties on the rowset that talk about concurrency, but none of these
implement the pessimistic concurrency you're talking about.
If the property DBPROP_CLIENT_CURSOR (I believe) is set to true, you have a
client-side cursor, otherwise you have a server-side cursor managed from the
client.
Just for my own curiousity, why do you feel that you need to manipulate rows
from the client/middle tier while keeping them locked on the server?? This
is the root cause of many a SQL locking problem (unless you're using a
versioning database (SQL2000 is not one), its not as big of a problem
there). Why not use SQL UPDATE statements?
Cheers,
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"Linz" <Linz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:04FA78A4-E1B0-42CE-A93B-D571C0AC099C@xxxxxxxxxxxxxxxx
> Hello All,
>
> I'm doing some SQL Server 2000 operations using OLEDB consumer template
> classes. I have to do a lot of updates() here, its working fine but I
> think
> its optimistic lock / client cursor. My requirement is when I open the
> rowset/cursor for updates, it should lock (it shouldn't allow others to
> edit
> this row) .. I think, I have to set pessimistic lock for this, how can I
> do
> this in OLE DB .. Please help me ..
>
> TIA ..
>
> Linz
>
>
.
- Prev by Date: How to pass database login screen
- Next by Date: Re: Read-Only Access to Excel
- Previous by thread: How to pass database login screen
- Next by thread: ORA-12154 err
- Index(es):
Relevant Pages
|
Loading