Joshua Caesar wrote:

Catch Ctrl-C as an exception , release your lock, let your program exit.

Yes, I know a little about $SIG{INT}, or rather I know enough about $SIG{INT} on Windows not to use it :-) . I did try it though, but the program is probably waiting on something deep inside DBD and the "pure" Perl part of it probably never regains control.

Anyway, "SET LOCK_TIMEOUT" works for me and the program dies. I realize that I probably should *always* use "SET LOCK_TIMEOUT", at least when autocommit is off.


-----Original Message-----
From: Roger Perttu [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 12:43 PM
To: [EMAIL PROTECTED]
Subject: DBD-ODBC, MS SQL and locks


Hi!

I'm having problems with table locks in MS SQL Server 7.0. I have more or less solved my problem using: $dbh->do('SET LOCK_TIMEOUT ' . LOCK_TIMEOUT); right after my call to DBI->connect(). I have a few questions though.

I'm wondering if DBI or DBD-ODBC tries to do any clean up if Ctrl-C is pressed during the execution of the program on W2k? In my case the Perl program was just waiting for a table lock to be released. This particular lock was held by an orphaned connection so I pressed Ctrl-C (resulting in yet another orphaned connection). By default it takes a very long time (hours) for SQL Server to realize that a connection have been orphaned. Would it be possible for DBI to autmatically close the connections when Ctrl-C is pressed?

/Roger P





Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to