Information générale
Titre:
SQL Server: Trigger LOCKS? (DEADLOCK problem)
Hi,
At some of my customers, i'm having problems with DEADLOCK problem.
We have a lot of triggers at some tables, with triggers a lot of SELECT and UPDATES.
I'm working with VFP 7.0, and my code is like this:
SQLEXEC(..., "BEGIN TRANSACTION")
lFlag = .t.
SELECT myRemoteView1
IF !TABLEUPDATE(.t., .t.)
lFlag = .f.
ENDIF
IF lFLag
SELECT myRemoteView2
IF !TABLEUPDATE(.t., .t.)
lFlag = .f.
ENDIF
ENDIF
IF lFlag
SQLEXEC(..., "COMMIT TRANSACTION")
ELSE
SQLEXEC(..., "ROLLBACK TRANSACTION")
ENDIF
Imagine that Tables from myRemoteView1 and myRemoteView2 have triggers that invoke a lot of Updates and Selects to other tables.
Since i invoked a transaction, what is SQL SERVER's work? Does he lock all the tables (or records?) existing in triggers?
Should i eliminate those "heavy" triggers and send their Select and Updates as single instructions from my application?
Thanks in advance.
Ricardo Almeida
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement