Home > Archive > MS SQL XML > July 2005 > SQL XML in a multi-threaded environment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL XML in a multi-threaded environment
ram_kri

2005-07-27, 1:28 pm

Hi Guys,
I definitely know
that there are 3 different xmls with different names and the Execute
method fails, when I try to run the same appliaction with 3 different
parameters *simultaneously * (So when I run the application with param1
it
should bulkload xml-1, when passed param-2 then it should bulkload xml-2
and when passed param-3 it should bulkload xml-3, all them have the same
schema and same staging tables into which the bulkloading happens.
Basically this is a console application and I give the params as command
line args to the application. Note that when I run the application in a
serial fashion (i.e first I run the app with param-1 wait until it gets
over then again run the app with param-2 and wait until it gets over
then again run with param-3). In this serial fashion there is no issue.
But using windows scheduler I scheduled to run the app with 3 different
params ( created 3 windows schedulers, and configured them to run
exactly at the same time, which is the requirement for us). Then the
execute method mails. Only of them them gets bulkloaded and the rest two
fail.
Note that all the 3 xmls comply to the same xsd.
Its an STA. Now anybody has any idea what's going on here ?
Thanks in advance !

Cheers,
Kris


ram_kri

2005-07-27, 8:24 pm

Hi Guys,
Let me give you more information :
It gives an error when the second bulk-load happens, when it calls the
Execute method. Because I am using a LateBinder and using reflection to
call the Execute method that I am not able to give you the whole
exeception.
the code is :

public object CallMethod(string methodName, object [] args)
{
if (_obj == null) throw new
ObjectDisposedExcept
ion(_type.Name);
return _type. InvokeMember(methodN
ame,
BindingFlags.InvokeMethod, null, _obj, args);
}

But this is what it gives :
1) Exception Information
********************
********************
*****
Exception Type: System.Reflection. TargetInvocationExce
ption
Message: Exception has been thrown by the target of an invocation.
TargetSite: System.Object CallMethod(System.String, System.Object[])
HelpLink: NULL

2) Exception Information
********************
********************
*****
Exception Type: System.ArgumentException
Message: The error log file could not be created. Make sure you have the
appropriate permissions and that the ErrorLogFilePath is valid.
ParamName: NULL
TargetSite: NULL
HelpLink: NULL
Source: Microsoft XML Bulkload for SQL Server

Any Idea ?
But when I run it one after the other, it all works.

Have a nice day.

ram_kri

2005-07-28, 1:39 pm

Hi Guys,
I removed the reflection part and now calling the Execute method directly.
And this is the exception it gives :
1) Exception Information
********************
********************
*****
Exception Type: System.Runtime.InteropServices.COMException
ErrorCode: -2147467259
Message: The statement has been terminated.
TargetSite: Void Execute(System.String, System.Object)
HelpLink: NULL
Source: Microsoft OLE DB Provider for SQL Server

Stack Trace Information
********************
********************
*****
at SQLXMLBULKLOADLib. SQLXMLBulkLoad3Class
.Execute(String
bstrSchemaFile, Object vDataFile)

Thanks in advance.
Have a nice day.

Cheers,
Kris

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com