Getting an error "table ... cannot be found in data packet"

In our silverlight application - we are occasionally getting an exception throw :
RemObjects.DataAbstract.DAException: Table '… ’ cannot be found in data packet

Any ideas what it means and how I can fix it ?

Hello.

This problem appears when data packet received from the server doesn’t contain requested table. Please check the requested data table name on the client side and data table name in SM on the server side. They must be identical. If all is well but the problem exists please send us small testcase with the problem to investigate it in details.

Thanks in advance.

I get this when I try to start two asynchronous calls on the same adapter…

Adapter.BeginExecute ( ) …

Then whilst waiting for the callback I issue another

Adapter.BeginExecute ( ) …

It seems the callbacks get confused and the wrong result goes to the wrong callback…

Can an adapter only handle one call ?
Is there some flag I can check to see if its already busy ?

Hello.

Can you send us small testcase with the problem to investigate it in details?

Thanks.

Its difficult to generate a “simple” testcase!

Is there some simple examples I can download and try to make fail in the same way ?

Hello Mike.

Yes, RemObjects DataAbstract contains sample “Silverlight” (see it at “C:\Users\Public\Documents\RemObjects Samples\Data Abstract for .NET\C#\Silverlight”) that works with DataAbstract Sample Server (see it at “C:\Users\Public\Documents\RemObjects Samples\Data Abstract for .NET\Server”). Please try to reproduce the problem with this testcase.

Thanks in advance.

I think you can replicate it easily in that example…

If you change the loadClients_Click to just run the selectClients, and then try to load the products at the same time :

private void loadClients_Click(object sender, RoutedEventArgs e)
{
Login();

        selectClients();
    }

    private void selectClients()
    {
        txtStatus.Text = "Loading Clients...";
        var q = (from x in linqRemoteDataAdapter.GetTable<Clients>() select x);
        IQueryable[] Queries = new IQueryable[] { q };
        linqRemoteDataAdapter.BeginExecute(
            Queries,
            delegate(IAsyncResult ar)
            {
                linqRemoteDataAdapter.EndExecute(ar);
                Dispatcher.BeginInvoke(new ProcessSelectClientsResultCb(ProcessSelectClientsResult), q.ToList<Clients>());
            },
            null);

        var Prodq = (from x in linqRemoteDataAdapter.GetTable<Products>() select x);
        IQueryable[] ProdQueries = new IQueryable[] { Prodq };
        linqRemoteDataAdapter.BeginExecute(
            ProdQueries,
            delegate(IAsyncResult ar)
            {
                linqRemoteDataAdapter.EndExecute(ar);
                Dispatcher.BeginInvoke(new ProcessSelectProductsResultCb(ProcessSelectProductsResult), Prodq.ToList<Products>());
            },
            null);
    }

When I run it I get :

RemObjects.DataAbstract.DAException was unhandled by user code
Message=Table ‘Products’ cannot be found in data packet
FromServer=false
StackTrace:
at RemObjects.DataAbstract.DataStreamer.GetDataReader(String aDataTableName)
at RemObjects.DataAbstract.Linq.LinqRemoteDataAdapter.EndFetchData(IAsyncResult ar)
at RemObjects.DataAbstract.Linq.LinqDataAdapter.EndExecute(IAsyncResult ar)
at DAClientSilverlight.Page.<>c__DisplayClass5.b__3(IAsyncResult ar)
at RemObjects.DataAbstract.BaseDataAdapter.AsyncResultWrapper.Callback(IAsyncResult ar)
at RemObjects.DataAbstract.BaseDataAdapter.AsyncResultWrapper.Callback(IAsyncResult ar)
at RemObjects.SDK.WinInetHttpClientChannel.AsyncState.GotResponse(IAsyncResult ar)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass19.b__17(Object state2)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException:

on the " linqRemoteDataAdapter.EndExecute(ar);" for the original query :
linqRemoteDataAdapter.BeginExecute(
Queries,
delegate(IAsyncResult ar)
{
linqRemoteDataAdapter.EndExecute(ar); // <<< HERE…
Dispatcher.BeginInvoke(new ProcessSelectClientsResultCb(ProcessSelectClientsResult), q.ToList());
},
null);

Hello Mike.

Sorry for the belated response.
Thank for the instructions. The problem has been reproduced. Unfortunately, it is not possible to get 2 resultsets in such a way. It is better to use the next code in this case:

     private void selectClients()
     {
      . . .
      var q = (from x in fDataModule.DataAdapter.GetTable() select x);
      var Prodq = (from x in fDataModule.DataAdapter.GetTable() select x);

      IQueryable[] Queries = new IQueryable[] { q, Prodq };
      fDataModule.DataAdapter.BeginExecute(
           Queries,
           delegate(IAsyncResult ar)
            {
                fDataModule.DataAdapter.EndExecute(ar);
                Dispatcher.BeginInvoke(new ProcessSelectProductsResultCb(ProcessSelectProductsResult), Prodq.ToList()); 
                Dispatcher.BeginInvoke(new ProcessSelectClientsResultCb(ProcessSelectClientsResult), q.ToList());
            },
            null);
      . . .
      }

Hope this helps.