Hi,
Before we get too far into the whys-and-wherefores of the thread thing,
have you installed SP1 for ND 4? Have you confirmed that the SP can be
executed in a conventional fashion from a SP object?
SP1 fixes some problems with SP's so if you have not applied it you may
well be beating a dead horse. One quick way to check is to create a quickie
project, add an SP object and just see of the SP runs successfully in this
arrangement. If so Service Pack 1 is less likely to fix the problem (but it
should be applied anyway).
evan
Ramakanth Padmanabhan Sengamedu wrote:
> Hi,
> I am involved in porting of applications from ND 3.11 to 4.1.3. We
> are using ND 4.1.3 on WINNT server.
> We have a stored procedure which involves export of data from a lot
> of tables and hence is time consuming.
> In order to avoid a timeout this stored proc was executed previously
> in a separate thread. The way we do this is
> by obtaining a handle to the dataobject and executing it in the run
> method of the new thread. However this fails
> in ND4.1.3. The code prior to dataObject.execute() in the run method
> is executed but the execute method is failing.
> The control does not even reach the onBeforeExecuteEvent of the
> dataObject. Can we not execute a dataobject in a separate thread in
> ND4.1.3? If we can, then is there anything that we need to do different from
> the existing code that is given below. Any help would be greatly
> appreciated .
>
> class ProcThread extends Thread
> {
> private CSpProcedure procedure;
>
> public final static int PROC_SUCCESS = 0;
> public final static int PROC_FAILED = 1;
> public final static int PROC_EXECUTING = 2;
>
> public static int procStatus = PROC_EXECUTING;
>
> public static int errCode = 0;
>
> ProcThread(CSpString str)
> {
> procStatus = PROC_EXECUTING;
> procedure = (CSpProcedure)
> CSpider.getDataObject("spExportData");
> procedure.clearAllValues();
> procedure.setValue("Parameter_IN", str);
> }
>
> public synchronized void run()
> {
> //Control comes here
> ...
> ...
> ...
> procedure.execute(); //it fails here
>
> if ( procedure.succeeded())
> {
> procStatus = PROC_SUCCESS;
> }
> else
> {
> errCode = procedure.getErrorCode();
> procStatus = PROC_FAILED;
> }
> }
> }
>
>
> Thanx for Ur Time,
> Ramakanth S P
> _________________________________________________________________________
>
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]