Re: Multi threading with ODBC
- From: "Mary Chipman [MSFT]" <mchip@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Aug 2006 20:12:28 -0400
If you're getting deadlocks, then it probably is an architecture
thing. This happens when two different processes are contending for
the same resource in order to complete a transaction, so one process
is arbitrarily picked as a deadlock victim. When coding your
transactions, make sure you're accessing resources in the same order.
For example, process 1 locks table A and needs B, and process 2 locks
B and needs A. If both processes access A first and then B, the second
process just goes into the wait queue until the first process
completes, which is usually in sub-second response time, unless you've
committed other transactional sins such as using pessimistic locking
or cursors.
--Mary
On Tue, 8 Aug 2006 06:21:26 -0700, Munish
<Munish@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I am writing a multi threaded Client Server application. I have written a dll.
in .Net to perform the database related operations. I am using connection
pooling. Now I have a function in the database dll. When multiple threads
enter in that function , I am getting the imporper results.
So , I thought of using transactions in that particualr function. But it is
causing the deadlock in the application.
Can anyone help me ? Is my desgin/architecture wrong > or there is something
else i m missing >
Regards
- Prev by Date: Custom driver failed when switch to unicode
- Next by Date: Re: SQLBindParameter & empty strings
- Previous by thread: Custom driver failed when switch to unicode
- Next by thread: Re: SQLBindParameter & empty strings
- Index(es):
Relevant Pages
|
|