Discussion:
sql locks not released when called from VFP8
(too old to reply)
Michael
2005-01-22 15:37:38 UTC
Permalink
I am running into some problems especially on deletes using SPT, VFP8 and
SQL 2000. I am seeing in EM where locks on objects from single row
deletions, i.e. delete dbo.tablename where id = ?paramID.

These locks are causing blocking and I am not sure how to get around it. If
I wrap the statement in a transaction (from VFP not in SQL), it seems to
clear the locks. Any help woul dbe greatlyu appreciated.

Thanks

Mike
Christian Ehlscheid
2005-01-24 00:21:54 UTC
Permalink
Hello,

if you have manual transactions enabled
(SQLSETPROP(connectionHandle,'Transactions',2))
the locks are hold as long as the transactions is in progress , that is
until you issue either a SQLCOMMIT() or SQLROLLBACK() call

if you want to handle each SQLEXEC call in it's own single transactions you
have to disable manual transaction mode
(SQLSETPROP(connectionHandle,'Transactions',1))
then VFP will automatically append

IF @TRANCOUNT > 1
COMMIT TRANSACTION
ENDIF

to each SPT statement you send to SQL Server with SQLEXEC

Regards
Christian
Post by Michael
I am running into some problems especially on deletes using SPT, VFP8 and
SQL 2000. I am seeing in EM where locks on objects from single row
deletions, i.e. delete dbo.tablename where id = ?paramID.
These locks are causing blocking and I am not sure how to get around it. If
I wrap the statement in a transaction (from VFP not in SQL), it seems to
clear the locks. Any help woul dbe greatlyu appreciated.
Thanks
Mike
Loading...