Ward,
I'm aware that if this is an INformix issue or IBM data provider issue, this is not your deal. However first of all I'm going to find a workaround such that this issue does not stop our development while we are solving the case, that can take months in particular if we need to work with IBM for a solution :-(
My work around was to create a query/insert/update/delete FIFO-queue for the EM, such that queries etc. stack up in the queue while a query is not replied from the server. In the Manager.Fetched and Manager.Saved handlers I check the queue for waiting items and send the next query/save command. I need a small help to do this.
I keep the queue in PersistenceGateway class and do a little ugly addition to IEntityManagerProvider class to enable the Repository class to access the PersistencGateway (I know, I know this should not be done...but needed for this):
using IdeaBlade.EntityModel;
namespace RN.Modules.Infrastructure { public interface IEntityManagerProvider {
EntityManager EntityManager { get; }
bool IsBusy { get; }
void QueueIt(object obj);
}
}
Now I change the Untyped query Query metod in the Repository class (se red addition):
//A a small data-class to store the query on the queue: public class UntypedQuery { public IEntityQuery PerformQuery; public Action<IEnumerable> PerformCallback; public delegate void FuncToCall(IEntityQuery query, Action<IEnumerable> callback); public FuncToCall FuncToCallDelegate; }
protected void Query(IEntityQuery query, Action<IEnumerable> callback) { string testThreadName = System.Threading.Thread.CurrentThread.Name; if (null == query) { QueryCallbackImpl(null, new List<object>() , callback ); return; }
if(p_entityManagerProvider.IsBusy) { UntypedQuery q = new UntypedQuery(); q.PerformQuery = query; q.PerformCallback = callback; q.FuncToCallDelegate = this.Query; p_entityManagerProvider.QueueIt(q); return; }
p_entityManager.DefaultQueryStrategy = QueryStrategy.Normal; // Ensure going to data source try { p_entityManager.ExecuteQueryAsync( query, args => QueryCallback(args, callback), null); } catch (Exception e) { QueryExceptionHandler(e, callback); } }
All fine and everything works. Now I want to do the same for the Strongly Typed Query method, but then I run into the problem. The strongly typed query method is defined such:
protected void Query<T>(IEntityQuery<T> query, Action<IEnumerable<T>> callback)
My problem is how in heck can I create the the data-class to store the parameters on the queue like I did for the untyped query:
public class TypedQuery { public IEntityQuery PerformQuery; //Not sure if this works to store the IEntityQuery<T> query parmaeter public ????? PerformCallback; // to store Action<IEnumerable<T>> callback parameter public delegate void FuncToCall<T>(IEntityQuery<T> query, Action<IEnumerable<T>> callback); public FuncToCall<?????> FuncToCallDelegate; // To store a "function pointer" to the strongly typed Query<T>() } I'm not good at this typed stuff. Is it in general possible to create such a data class to stor the parametes of the strongly typed Query method?
Then my last question: If I upgrade to DevForce 2010. I will have to upgrade to Visual Studio 2010 and .NET4, isn't it? As a DevForce customer whered do I download the DevForce upgrade from? Do I simply download the free Express Edition and apply our licence to it...or is it something more complex?
|