On Jun 17, 1:49 pm, Jonathan Pryor <[email protected]> wrote: > > I'm still not sure how to fix it though. :-/ I'm philosophically > opposed to a global QueryCache (global data is bad!), and a > per-DataContext QueryCache doesn't make lots of sense. > > I thus see two solutions: > > 1. Figure out why query creation takes so long, and speed it up. (The > same should be done for the constructor, for that matter.) > > 2. Use a QueryCache, but instead of making it an internal implementation > detail -- meaning the user has ~no control over its lifetime -- make it > something the user can control. This could be done by making QueryCache > a public type, and adding a DataContext.QueryCache property. If the > user wants to use a cache, they can create a global cache and provide it > to the DataContext as part of their initialization steps. > > This gives control of the cache to the user, allowing them to easily > monitor size and provide cache policy, without creating an > internal-to-DbLinq-memory-leak-in-waiting. >
One thing that I have thought about a few times over the past month as I have to up to speed on DbLinq is whether the library should be doing less rather than more. The two really cool things DbLinq can do are firstly translate LINQ expressions to SQL for a variety of databases and secondly generate the SQL for CRUD operations on .Net classes also for a variety of databases. Would it be better if DbLinq rather than taking control of the whole database operation was used to generate the parameterised SQL. I know that doesn't fit with the whole Linq2SQL API DbLinq is triving towards and I'm not even sure if there it's entirely feasible or even a good idea. I just thought I'd throw the idea out there as it does solve a number of issues such as DbLinq having to worry about query caching and of course my favourite issue database connection pool usage. Regards, Aaron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DbLinq" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dblinq?hl=en -~----------~----~----~----~------~----~------~--~---
