Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What to log when alias is not open?
Message
 
 
To
09/11/2016 15:03:24
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01642948
Message ID:
01642999
Views:
26
>>>Hi,
>>>
>>>I review customers' error log files and very often see the error of a certain view (CursorAdapter cursor) not open where it is supposed to be open. Obviously something happens before the error, perhaps another error, that leads to the missing cursor. But customers don't report the errors and so I have to figure out on my own what happens. So I am planning to create a "hidden" log of information. Some information will be written in this log file every time the CA cursor is not open (where it is supposed to be open).
>>>
>>>My question is, what kind of information can I write in the log to help me get to the why the problem occurs?
>>
>>Since the cursor that is not open is always associated with the certain BIZ object (Cursor Adapter object), I will probably check if the BIZ object is instantiated and some other properties of this BIZ object. Hopefully this will help to track the problem.
>>Any comments/input would be appreciated.
>
>I wouldn't mind some more information on this topic myself.
>
>I was recently doing some maintenance on a VMP5-based app. Some columns needed to be added CA classes. While adding them I ran into a couple of problems:
>
>1. One of the CAs has a GROUP BY clause. Initially I forgot to add the new columns to that clause (required by default in ENGINEBEHAVIOR 90)
>
>2. In another CA some of the added columns are NULLable and in the results of some queries could return NULL values for every row. I ended up having to add NULL to those column definitions in the Schema
>
>What surprised me was that these problems caused the creation of the CAs to fail "silently" i.e. there would be no error showing up until a form control tried to use the CA/view as its data source. I had to trace in the debugger, and manually simulate the CA .SelectCmd in SSMS. Also, having the previous (working) code to look at helped. With those aids and educated guesses I was able to figure out what was going on but that's not an approach you can use in production.
>
>I'm a bit surprised at this silent failure behaviour, I would have expected the VMP framework to handle it better.
>
>Nonetheless, in my case at least the first issue is getting an error (or some other trappable event) to occur at failure of the CA to be properly created. Until that happens, any logging will be of very limited use.

I don't know anything about this framework that you use. But I create a BIZ object that I use for ALL of my table CursorAdapters.
And the way I check for the error is as follows:
When the CA object is instantiated and there is an error, my code still instantiates the object. One of the properties of the CA object is VIEW_ALIAS_NAME (name of the alias set to the cursor of the Cursor Adapter). Then I always check (usually in the INIT method of the form where the BIZ object is used) if the cursor of the name VIEW_ALIAS_NAME is open. If it is not open, there is problem and the code returns the error. It works very well.

The problem I experience (of this thread) is the at some point in some other method of the form the alias name VIEW_ALIAS_NAME is closed. This is what I am trying to figure out; where the and what closes this alias.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform