-
Custom collections
Anyone got a solution for following problem:
I've created a custom collection (inheriting from DictionaryBase) that serves
as a cache object. Meaning when you are calling the Item method on the collection
the method is checking first if the item you want is already available in
its internal dictionary, if not it's retrieving it first from a datastore
and placing it in its internal dictionary. The next time you ask for the
same item you know it's comming from the dictionary.
The problem is when I write my code with a hardcoded key like this:
msgbox(object.Item("1002").Name)
it just seems the item is already there and I'm pretty sure I'm only calling
this method the first time since it's in a test application of a few lines.
Now when asking for the key like this:
msgbox(object.Item(Inputbox("Key")).Name)
everything works like it should work.
When attaching a webservice to the Item method, very strange debugging problems
occur. The debugging is sometimes already stopping a few lines before this
code or just skipping parts of the debugging and stopping when the webservice
is actually returning the result. Always ending with an application that
hangs.
Anyone any suggestions,
Chris
-
Re: Custom collections
Have you tried extracting the webservice statement to a seperate line? There
may be complications or marshalling complications since the client and server
are two seperate processes (even if tested on the same machine, it is 2 processes)
Using the Inputbox() as an example:
sUserInput = Inputbox("Key")
msgbox(object.Item(sUserInput).Name)
Extracting that statement might make it easier to debug, it also lends itself
to be a bit cleaner so that you can check the collection with the key entered
before attempting to access the element.
Steve.
"Chris Deceuninck" <deceuninck@yahoo.com> wrote:
>
>Anyone got a solution for following problem:
>
>I've created a custom collection (inheriting from DictionaryBase) that serves
>as a cache object. Meaning when you are calling the Item method on the collection
>the method is checking first if the item you want is already available in
>its internal dictionary, if not it's retrieving it first from a datastore
>and placing it in its internal dictionary. The next time you ask for the
>same item you know it's comming from the dictionary.
>
>The problem is when I write my code with a hardcoded key like this:
>
>msgbox(object.Item("1002").Name)
>
>it just seems the item is already there and I'm pretty sure I'm only calling
>this method the first time since it's in a test application of a few lines.
>
>Now when asking for the key like this:
>
>msgbox(object.Item(Inputbox("Key")).Name)
>
>everything works like it should work.
>
>When attaching a webservice to the Item method, very strange debugging problems
>occur. The debugging is sometimes already stopping a few lines before this
>code or just skipping parts of the debugging and stopping when the webservice
>is actually returning the result. Always ending with an application that
>hangs.
>
>Anyone any suggestions,
>
>Chris
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks