Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

OdbcConnection : concurrent transaction, IsolationLevel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hak?na k? - 06 May 2004 21:28 GMT
Hello ,

I need help to How I Can serialize Query with .NetFramework
and Odbc SQLServer Connection ...

I want that  :
1. Client A read "name,lastname" from query
2. Client B try to read "name,lastname" but .Net must block the query
3. Client B is waiting that client A have release the block
4. Client A update "name,lastname"
5. Client A close the transaction
6. Client B read "name,lastname" and exit from Block "state"
7. Client B is happy :-))

How I can do it ?!
OdbcTransaction can allow me to do it ?!

thank all

Hak?
David Browne - 06 May 2004 23:15 GMT
> Hello ,
>
[quoted text clipped - 12 lines]
> How I can do it ?!
> OdbcTransaction can allow me to do it ?!

Yes.  Each client should enlist all Commands in a transaction.

Then if client A issues
  SELECT name,lastname from t with(updlock) where id = ?

This will select one row and lock it for the duration of client A's
transaction.

David

David
Hak?na k? - 07 May 2004 08:26 GMT
> Then if client A issues
>    SELECT name,lastname from t with(updlock) where id = ?
>
> This will select one row and lock it for the duration of client A's
> transaction.

Hello ,

But :

myTransaction.BeginTransaction(IsolationLevel.ReadCommited);
myCommand.transaction = myTransaction;

What is ?
My code not lock the row/s affected of Query ?

And what is "updlock" ?
How I find documentation on this method ?

Huk?
David Browne - 07 May 2004 14:30 GMT
> > Then if client A issues
> >    SELECT name,lastname from t with(updlock) where id = ?
[quoted text clipped - 13 lines]
>
> And what is "updlock" ?

Use update locks instead of shared locks while reading a table, and hold
locks until the end of the statement or transaction. UPDLOCK has the
advantage of allowing you to read data (without blocking other readers) and
update it later with the assurance that the data has not changed since you
last read it.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_con
_7a_1hf7.asp


> How I find documentation on this method ?

SQL Books Online, or MSDN

David

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.