473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

EL Caching Block and Dispose

If I place objects into the cached that implement an IDispose, are they
automatically disposed when removed? Looking at the code it doesn't
appear so. How can I handle this? Anyone with a suggestion?

Chris

Jul 27 '05 #1
5 1301
What types of objects you are disposing? Are they holding on to any resouces?

http://msdn.microsoft.com/library/de...izeDispose.asp

You mention something about a code (???) can you post it?

Erick Sgarbi
If I place objects into the cached that implement an IDispose, are
they automatically disposed when removed? Looking at the code it
doesn't appear so. How can I handle this? Anyone with a suggestion?

Chris

Jul 28 '05 #2
In this particular case, I was caching a DataSet. The code I am
referring to is the Enterprise Library source code.

Jul 28 '05 #3
The Dispose method in a dataset will not dispose of any tables or rows (never
touch them). You usually dont need to worry about datasets unless they are
extremelly huge and are being marshalled somewhere. The GC is very efficient
in getting rid of instances that are deferenced from root instances.

HTH,

Erick Sgarbi
www.blog.csharpbox.com
In this particular case, I was caching a DataSet. The code I am
referring to is the Enterprise Library source code.

Jul 28 '05 #4
My concern is not about datasets in particular. I am concerned about
caching any object that requires disposing using the Enterprise
Library. The Tnterprise Library does not seem to call Dispose when an
object that requires it is removed from the cache.

Jul 29 '05 #5
> The Tnterprise Library does not seem to call Dispose when an object that
requires it is removed from the cache.

No need to dispose of your managed objects if they don't use unmanaged resouces.
If they "do" need to be disposed, make sure they implement the dispose pattern
by writting a finalizer... even though finalizers are expensive, you at least
will be certain that "eventually" your unmanaged resources will be freed.
Furthermore, you can always modify or bake your own caching engine.
HTH,

Erick Sgarbi
www.blog.csharpbox.com
My concern is not about datasets in particular. I am concerned about
caching any object that requires disposing using the Enterprise
Library. The Tnterprise Library does not seem to call Dispose when an
object that requires it is removed from the cache.

Jul 29 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve W | last post by:
I have an ASP.NET app that calls into some VB.NET components. It passes in the current application's cache (HttpContext.Current.Cache). These VB.NET components also get called by a non-ASP.NET...
5
by: DC Gringo | last post by:
I am having a problem reading a simple update to the database. Basically I'm testing a small change to the pubs database -- changing the price of the Busy Executive's Database Guide from 19.99 to...
5
by: Chris Dunaway | last post by:
If I place objects into the cached that implement an IDispose, are they automatically disposed when removed? Looking at the code it doesn't appear so. How can I handle this? Anyone with a...
5
by: michaeltorus | last post by:
Is the only way to cache data in Memory, such as a Dom Document, to use System.Web.Caching namespace? I can't seem to find anything else, but what if you want to cache something in memory and you...
1
by: Ashish | last post by:
I am thinking about using Caching application block in my web application, for the performance reasons. My ideal sitiuation would be if i could plug in the application block between my...
8
by: Andrew Robinson | last post by:
Are these two equivalent? Is one better than the other? I tend to go with #1 but started wondering.... Thanks, 1: using (SqlConnection cn = new SqlConnection(DataConnection)) using...
4
by: Hermann | last post by:
My site is a bit slow showing the main page so I thought caching query result in PHP will improve performace. Then I read MySQL documentation and saw that MySQL does have a caching feature. So......
9
by: TC | last post by:
Hey All, I posted this to the Crypto users group and forgot to add the VB.Net users group. I apologize for any confusion. I have been testing a try / catch / finally block and purposely...
5
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm researching what is the best way to create a generic WCF proxy wrapper that has the following requirements: 1. Remove the System.ServiceModel config section requirement for clients. We have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.