|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Perl Query Locks A MsSQL Databaseby tobyink (Prior) |
| on Jan 23, 2013 at 20:31 UTC ( #1015018=note: print w/ replies, xml ) | Need Help?? |
|
Firstly, how are you connected? FreeTDS or ODBC? If you're connected through FreeTDS, it's pretty difficult to have two queries running concurrently on the same database handle. You need to finish your select before you run any updates. A workaround is to open two database handles on the same database. Secondly, by default MSSQL locks whole pages and often whole tables while one query is running, meaning a situation like yours is likely to cause deadlocks. You could experiment with adding some table hints to your select query; possibly ROWLOCK, perhaps even NOLOCK as a last resort.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||