DataSource Locks from 2 applications

B

Bob Day

Using VS 2003, VB.Net, MSDE, ADO.net with disconnected datasets.

I have two applications, AppA and AppB. AppA is a multit thread application
that uses Synclock when accessing a datasource (such as a DataAdapter.Update
command). AppA works fine. AppB is a single thread, but must access the
same DataSouce as AppA while AppA is possibly accessing it also. These are
both winform applications on a desktop Windows XP.

Question 1) - Just considering AppA running by itself, do I need to worry
about locking on the SQL level (i.e. in the actual SQL commands used by the
DataAdapters)? I have skimmed the SQL information, and it looks like I
could create locks on that level in addition to the SyncLock level in the
VB.Net code. It would seem to me that this would not be necessary, that
SyncLock is all I need to do.

Question 2) - Now consider AppA and AppB running at the same time. If AppA
has a datasource open for an Update, If AppB tired to try open it, what
happens? I assume it would either a) fail, b) act in a fashion similar to
Synclock, and wait its turn until the DataSource was availalbe. I am not
sure which, and if it would fail, how to I protect against that? Synclock
in AppB would be of no value (becase it doesn't know what is going on in
AppA).
How, how do I wirte AppB to access a common datasource without problems?
Any URL to sample code is appreciated.

I am not an SQL programmer, so I am hopping you answer does not involve low
level SQL programing.

Thanks!
Bob Day
 
K

Kevin Yu [MSFT]

Hi Bob,

I have posted a reply on another thread you have posted in
microsoft.public.dotnet.framework.adonet. Please go there and pick it up.
Thank you!

If anything is unclear, please feel free to reply to that post.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top