Does anyone have example multi-threading InfoPath 2003???

J

John Amason

InfoPath 2003 SP2 is being used.

Repeating table an have 1-500 rows obtained by call web service to retrieve
data.

Rows are added one by one using appendChild. A bit slow, takes ~ 2 minutes.
Ok with user but would be nice if faster.

Retrieving collection of rows from web service takes several minutes which
is ok.

Adding content from collection to each row takes a long time with 100% CPU
utilization.

If the number of rows is less than 50, the performance is ok, but above that
performance degrades rapidly.

Idea is to multi-thread the application, so that when button is pressed,
control is returned to user and table is populated 50 rows with a wait in
between until complete.

Having problem using multi-thread because the thread cannot access
thisDocument.DOM.

Following is code snippit for button:

InfoPathEventHandler(MatchPath="CTRL199_5",
EventType=InfoPathEventType.OnClick)]
public void CTRL199_5_OnClick(DocActionEvent e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(ValidateESIIDThread),
thisXDocument);
}

Code snippit for method is:

public void ValidateESIIDThread(object XDocument)
{
....
XDocument thisXDocument = (XDocument) XDocument;
....
try
{
string SomeDataVal =
thisXDocument.DOM.selectSingleNode("my:myFields/my:Business/my:SomeData").text;
....
}
catch (Exception ex)
{
thisXDocument.UI.Alert(ex.Message);
}
}

Error trying to read data source for SomeData is "operation is not valid due
to the current state..."

So, I guess that reference to thisXDocument is invalid.

Does anyone have example multi-threading InfoPath 2003???
 
J

Josh

Try using this.thisXDocument.

Josh



Chris said:
I have a similar issue. Did you determine if InfoPath supports multithreading?

Chris

John Amason said:
InfoPath 2003 SP2 is being used.

Repeating table an have 1-500 rows obtained by call web service to retrieve
data.

Rows are added one by one using appendChild. A bit slow, takes ~ 2 minutes.
Ok with user but would be nice if faster.

Retrieving collection of rows from web service takes several minutes which
is ok.

Adding content from collection to each row takes a long time with 100% CPU
utilization.

If the number of rows is less than 50, the performance is ok, but above that
performance degrades rapidly.

Idea is to multi-thread the application, so that when button is pressed,
control is returned to user and table is populated 50 rows with a wait in
between until complete.

Having problem using multi-thread because the thread cannot access
thisDocument.DOM.

Following is code snippit for button:

InfoPathEventHandler(MatchPath="CTRL199_5",
EventType=InfoPathEventType.OnClick)]
public void CTRL199_5_OnClick(DocActionEvent e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(ValidateESIIDThread),
thisXDocument);
}

Code snippit for method is:

public void ValidateESIIDThread(object XDocument)
{
....
XDocument thisXDocument = (XDocument) XDocument;
....
try
{
string SomeDataVal =
thisXDocument.DOM.selectSingleNode("my:myFields/my:Business/my:SomeData").text;
....
}
catch (Exception ex)
{
thisXDocument.UI.Alert(ex.Message);
}
}

Error trying to read data source for SomeData is "operation is not valid due
to the current state..."

So, I guess that reference to thisXDocument is invalid.

Does anyone have example multi-threading InfoPath 2003???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top