[VSRV][V4RB] connection status

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Sep 4 23:29:28 CDT 2003


on 9/4/03 11:13 PM, Tim Davis at timdavis at amug.org wrote:

Hi Tim,

>>>>> Server boolean property of db.IsOpen (testing connection status)
>>>> Yes, it's already implemented.
>>> In the current or upcoming version of V4RB, because I don't see IsOpen
>>> available?
>> IsOpen() will not work in that way.
>> It will repeate logic of local db.
>>     -- AFTER open() it returns TRUE always
>>     -- AFTER close() it returns false.
> 
> Sorry, for some reason I'm not getting this. I understand open and
> close. Can the client ask the server if the connection is open? Or do I
> have to simply call Open(), (in which case it will reopen if
> closed/disconnected), and therefore is always true. If so, in reality
> I'm opening/reopening rather than asking if connected. Or am I way off?

1) I think everybody agree that it is not pleasant call check each time.

2) so we have next:


start:
    try{
        // you do some operation
        db.Anything()
    
    }catch
    {
        // ops no connection.
        // what we can do here?

        // ANYTHING develoepr want

        1) may be close window that show result of cursor

        2) may be db.Open(name), this means Reconnect() with to the same db
            and then goto start;
    
        3) may be wrap calls to db by loop to avoid goto.
            it looks to be normal practic.
   }

In any case. Deal of Valentina -- throw exception (or return error code for
languages that have no exceptions.

Deal of developer to catch exception or check error code AFTER operation,
And decide what to do next.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list