473,396 Members | 1,884 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,396 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 1305
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.