About DBLINQ 0.19 with DataCaching (Backend : Mysql, Oracle)

0 views
Skip to first unread message

Dip's

unread,
Nov 21, 2009, 4:26:59 AM11/21/09
to DbLinq
hi

I m new for DBLINQ 0.19.
I dont know more about DBLINQ 0.19

but i want to be assure that DBLINQ 0.19 can internally manage Data
caching or Developer(s) have to implement these Data cahing.

this example shows you there is one datacontext "test" here, i have
created object of this "test" for get all product data without Data
Cahing manage from my side, so the question is will i get this
"AllProduct" data 2nd time from Cache or it will again(2nd time) make
DB call to retrive "AllProduct".


Exa:
test.Test db = new test.Test();
var AllProduct = (from d in db.TestoraDbid
select d);



or i have to implement Data Caching from my side in business logic for
reducing DB Call.


another issue is DBLINQ 0.19 QueryCahe is different then the Microsoft
Precomplile query.

Thanks in advance....

Jonathan Pryor

unread,
Nov 21, 2009, 9:24:16 AM11/21/09
to dbl...@googlegroups.com
On Sat, 2009-11-21 at 01:26 -0800, Dip's wrote:
> but i want to be assure that DBLINQ 0.19 can internally manage Data
> caching or Developer(s) have to implement these Data cahing.

The DataContext does maintain references to all entities created (in
order to support change tracking). This does constitute a cache (of
sorts), and we do ensure that subsequent queries return the same
objects. For example, see WriteTest.E1_LiveObjectsAreUnique() [0]:

//grab an object twice, make sure we get the same object each time
Northwind db = CreateDB();
var q = from p in db.Products select p;
Product product1 = q.First();
Product product2 = q.First();
Assert.AreSame(product1, product2);

> this example shows you there is one datacontext "test" here, i have
> created object of this "test" for get all product data without Data
> Cahing manage from my side, so the question is will i get this
> "AllProduct" data 2nd time from Cache or it will again(2nd time) make
> DB call to retrive "AllProduct".

That would appear to be the case (see above test), though there may be
some corner case I'm currently unaware of.

> another issue is DBLINQ 0.19 QueryCahe is different then the Microsoft
> Precomplile query.

This is a known issue, and won't be resolved until 0.20 (at least).

- Jon

[0]
http://dblinq2007.googlecode.com/svn/trunk/src/DbLinq/Test/Providers/WriteTest.cs


Reply all
Reply to author
Forward
0 new messages