Print Page | Close Window

Disconnecting the App

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1174
Printed Date: 07-May-2024 at 12:53pm


Topic: Disconnecting the App
Posted By: *Calsy
Subject: Disconnecting the App
Date Posted: 30-Mar-2009 at 3:27pm
Hi All, Im currently prototyping up disconnected functionality for our application. I cache all data needed locally than disconnect the PM. The problem is than I get a lot of errors stating "DataSource fetch strategies are not allowed when disconnected". The problem is that we set the querystrategy in our queries throughout the system. Is there anyway that when the PM is disconnected that it disreguards the querystrategy setting? Or do I have to write case statements around all our getentity calls?
 
Thanks



Replies:
Posted By: kimj
Date Posted: 31-Mar-2009 at 12:01pm
Matthew, I assume you're still working with DevForce Classic, although the issue exists in DevForce Silverlight too.  We currently assume if you've set the fetch strategy to DataSourceOnly or DataSourceThenCache that this was intentional, and document that the InvalidOperationException will be thrown if the PM is disconnected.
 
Setting the PM.DefaultQueryStrategy to a cache-only option is usually a good idea when going disconnected.  If you need to set the strategy on either the queries or with the Get* calls, then, yes, you will need to provide your own scheme for switching the strategy based on connection state.



Print Page | Close Window