Running the dummy query on the original EmtityManager works but I would like to be able to reconnect with another EntityManager.
why ? because I find to have to execute a query dummy before every call very annoying so I want to encapsulate the Invoke method frrom the SignalR.IHubProxy with this query call inside.
if I create a new EntityManager with the same ConnectionOption (cocktail) as the EntityManager I used to login in the application it doesn't work although they have the same sessionKey !
I noticed if I create an entityManager from the disconnected EntityManager it works (with new EntityManager(em)).
but if I create it from an EntityManagerContext using the same values as the one in the disconnected em it doesn't.
var context = new EntityManagerContext(
dataSourceExtension : disconnectedEm.DataSourceExtension,
entityServiceOption: disconnectedEm.EntityServiceOption,
compositionContextName: disconnectedEm.CompositionContext.Name,
options: disconnectedEm.Options,
serviceKey: disconnectedEm.ServiceKey);
I don't really understand why in some case it works and not in others. what is the use of the sessionkey if a newly entitymanager using the same sessionkey of the disconnected one doesn't do the job.
is it possible to achieve my scenario with cocktail ?