Using LINQ to query nested classes in db4o?

You didn't post the exact definition of your classes but you are currently doing a cartesian product in your Linq query - you are creating every possible combination whereas you really only want "matching" combinations (since a trading day in your schema for some reason seems to be associated with a symbol). What you should do instead is a join, something like: from TradingDay t in db4o. Db join Symbol s in db4o.

Db on s. SymbolGlobal equals t. SymbolGlobal where (s.

SymbolGlobal == "IBM" && t. Date == new DateTime(2010, 10, 19)).

You didn't post the exact definition of your classes but you are currently doing a cartesian product in your Linq query - you are creating every possible combination whereas you really only want "matching" combinations (since a trading day in your schema for some reason seems to be associated with a symbol). What you should do instead is a join, something like: from TradingDay t in db4o. Db join Symbol s in db4o.

Db on s. SymbolGlobal equals t. SymbolGlobal where (s.

SymbolGlobal == "IBM" && t. Date == new DateTime(2010, 10, 19)) ...

The cause of the error is exactly right. Unfortunately, db4o doesn't really support joins that well, as it falls back to LINQ-to-objects and loads the entire database into memory in an attempt to find the correct resolution. I think it might be better to abandon LINQ and use QBE (Query By Example) to solve the problem.

– Gravitas Feb 23 at 19:44.

I also added a global Client reference so that we could just reference the db4o container in a LINQ query without explicitly instantiating a container. We now even need less code for accessing a db4o database.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions