Are you using Remoting or WCF?
Are you using a BOS? If so, are using IIS, Windows Service, or Console Server?
Do all RPC calls exhibit this behavior, or is it just one or a few?
Here is some documentation on InvokeServerMethodAsync
Asynchronous version of RPC call (#467)
PersistenceManager now contains an overloaded InvokeServerMethodAsync method which allows for asynchronous invocation of a server-side method. This method works similarly to the synchronous InvokeServerMethod, except that the method return data is available in the event arguments passed to the InvokeServerMethodCompleted event. An outstanding request can be canceled using the CancelAsync method.
private void MakeAsyncCall() {
PersistenceManager pm = PersistenceManager.DefaultManager;
// Setup completion handler
pm.InvokeServerMethodCompleted +=
new EventHandler<InvokeServerMethodCompletedEventArgs>(InvokeServerMethodCompletedHandler);
// Make async call
Guid myToken = Guid.NewGuid();
pm.InvokeServerMethodAsync(new ServerRpcPersistenceDelegate(Order.GetNumberOfOrdersSlow), myToken,
new DateTime(1995, 1, 1), new DateTime(1999, 1, 1));
}
private void InvokeServerMethodCompletedHandler(object sender, InvokeServerMethodCompletedEventArgs e) {
Guid token = (Guid)e.UserState;
if (!e.Cancelled) {
MessageBox.Show("my async result = " + Convert.ToInt32(e.Result).ToString());
}
}
There is also a Tech Tip which you might find relevant:
http://www.ideablade.com/techtip_Extract_Maximum_Data_Retrieval_Performance.htm
Edited by davidklitzke - 03-Sep-2008 at 10:38am