Problem: to execute linq query on Iqueryable object that is non local (remote object)
Solution: generic IQueryable local proxy that will call some remote proxy, and this remote proxy will locally IQuery remote object
why not just remote this Iqueryable remote object – because Expression is not serializable
in fact Expression can have local code calls so in some situations it may be hard to serialize it.
BUT some subset of all-possible-Expressions-set IS serializable. Actually (today): “could be if done manually”
questions:
-
will there be
any mechanism like above solution in final orcas bits
- anyone already done such generic IQueryable proxy
- any comments

remoting IQueryable
Xadja
The problem is not only with local code. Expressions can also refer to local data - fields, locals (captured in closures) etc. It is very likely that such data will not be serializable. It is especially easy to start using local data when expressions are created indirectly as in queries.
I guess it would be easier to create the queries on the remote object where you are going to run them.
Thanks,
Vladimir
Sailu
For sure it is easier. And what is far more important: in most cases it is even more architecturally proper
But for sure there ARE cases when someone needs distributed query execution.
I just wanted to point that one can construct generic proxy mechanism that works on all IQueryable objects. This generic proxy solution will work witch all linq enadled (>>IQuerable enabled) stores.
Talking about implementation – witch local data it is easier because:
- if they are serializable > serialize them
- if they are call-by-reference remotable – call-by-reference remote them
- if non of those above – generate exception and nothing helps
And witch code calls one can:
- check assembly (& its version) it been loaded from
- check if this assembly is loaded in remote side
- if not loaded if it could be found on remote side
- if could be not found – send it to remote side
- and when because of code-dependencies exception occurs on remote side – catch exception and do above for dependencies
hihi – but what about security in above case ;p caller has to be certified :O)
As queries tend to run many times (with changes in data not in code) – above code procedure will be executed only once.
If someone is about doing above in open source manner – please let me know :O)
RyanB88
brian_tsim