I Currently Use AtomsFramework 0.1.8
I'm not. Is it a bug only for vb.net ?
Public Function Find(.....) As .....
.
.
For Each x In Me
.
.
If ce.IsExpired(interval) And Not ce.PersistentObject.IsDirty Then
Debug.WriteLine("Cache - Removing expired object from cache during Find()")
MyBase.Remove(x.Key)
Else
.
.
Next x
I got a Error When Cache Expire.
I Change To
Dim Remove_List As New ArrayList
For Each x In Me
.
.
If ce.IsExpired(interval) And Not ce.PersistentObject.IsDirty Then
Debug.WriteLine("Cache - Removing expired object from cache during Find()")
Remove_List.Add(x)
'MyBase.Remove(x.Key) 'delete object from cache Remark By Leng 20040701
Else
.
.
Next x
' Start Add By Leng 20040701
For Each x In Remove_List
MyBase.Remove(x.Key)
Next
' Start End By Leng 20040701
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's not actually a VB.NET bug, but rather a bug in the way I was clearing items from the collection. You can't actually remove items from a collection without it invalidating the iterator for the collection.
Your code is very appreciated (as always), however I've already fixed this problem in the current version (I can't remember if the fix is in 1.22 or only in CVS). In either case v0.1.8 is quite old now and I would recommend that you update to the latest version when you get a chance.
- Richard.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I Currently Use AtomsFramework 0.1.8
I'm not. Is it a bug only for vb.net ?
Public Function Find(.....) As .....
.
.
For Each x In Me
.
.
If ce.IsExpired(interval) And Not ce.PersistentObject.IsDirty Then
Debug.WriteLine("Cache - Removing expired object from cache during Find()")
MyBase.Remove(x.Key)
Else
.
.
Next x
I got a Error When Cache Expire.
I Change To
Dim Remove_List As New ArrayList
For Each x In Me
.
.
If ce.IsExpired(interval) And Not ce.PersistentObject.IsDirty Then
Debug.WriteLine("Cache - Removing expired object from cache during Find()")
Remove_List.Add(x)
'MyBase.Remove(x.Key) 'delete object from cache Remark By Leng 20040701
Else
.
.
Next x
' Start Add By Leng 20040701
For Each x In Remove_List
MyBase.Remove(x.Key)
Next
' Start End By Leng 20040701
Hi Leng,
It's not actually a VB.NET bug, but rather a bug in the way I was clearing items from the collection. You can't actually remove items from a collection without it invalidating the iterator for the collection.
Your code is very appreciated (as always), however I've already fixed this problem in the current version (I can't remember if the fix is in 1.22 or only in CVS). In either case v0.1.8 is quite old now and I would recommend that you update to the latest version when you get a chance.
- Richard.