clientServerChannel,
serializationPolicy);
ClientChannel channel = new ClientChannel(connection, false,
// we want events, but we don't want thread leaks, so creating single threaded EM.
// TODO: replace with container managed ClientCase.
new DefaultEventManager(0),
false);
CayenneContext context = new CayenneContext(channel, true, true);
context.setQueryCache(new MapQueryCache(10));
return context;
}