June 22, 2007 at 4:59 am
Hi all, Im using the following code to try and stor the created date of a text file as a variable but i seem to be getting a deadlocking error as follows:
A deadlock was detected while trying to lock variable "System::InteractiveMode, User:OC" for read access. A lock could not be acquired after 16 attempts and timed out.
If you guys can help me out ,offer a change in code or anything then its much appreciated.
Public Sub Main()
'
' Add your code here
'
Dim variables As Variables
Dim CREATED As String
Dim DOC As String
If Dts.Variables.Contains("DOC") = True Then
Dts.VariableDispenser.LockOneForRead(
"DOC", variables)
CREATED =
CStr(File.GetCreationTime(CStr(variables("DOC").Value)).ToString())
Dts.Variables(
"DOC").Value = File.GetCreationTime(CStr(variables("DOC").Value)).ToString()
End If
Dts.Variables.Unlock()
Dts.TaskResult = Dts.Results.Success
End Sub
June 26, 2007 at 3:54 am
The variable handling is shaky when using variables like that. Your best bet is to LockOneForRead and assign it to an internal variable, unlock it, and use it like that.
Also, there where plenty fixes in sp1 + updates. Have you installed that or sp2a? Just for good measure.
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply