VServer questions -- NOTE 1.

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Dec 12 11:38:01 CST 2006


On 12/12/06 11:30 AM, "Ivan Smahin" <IvanSmahin at public.kherson.ua> wrote:

Hi Charles,
Hi All,

> CY> Once you've established a connection to a VServer from a V4Rb client
> CY> and opened a database using the connection, VConnection.IsConnected
> CY> returns true, and VDatabase.IsOpen returns true.  But what happens
> CY> when, say, the server shuts down?  It turns out that IsConnected and
> CY> IsOpen still return true.  So there doesn't appear to be a way to
> CY> determine whether a connection is actually working other than to try
> CY> something.
> 
> Well,   just   for   now  we  have  "client-driven"  system.  So every
> activity in the server is result of some command issued by the client.
> I  mean  there  is  no  client-callbacks  registered in the server. So
> server  is  not able to issue some broadcast message like "I'm turning
> off".  We don't use this way because it means multi-threaded vclient -
> it is not suitable for some our plugins.
> 
> Now  I  will  try  to  improve connection.IsOpen() method checking the
> socket  state,  but  you  know  -  it could be wrong result because of
> socket nature. So it is always good idea to catch "network exceptions"
> everywhere.

> CY> But if the server has quit, the result is not so good.
> CY> When I attempt to close a VDatabase object in this situation, I get
> CY> VException &h6050a, ERR_STREAM_READ_ERROR. Then the app quits
> CY> abruptly with only this entry in the console log.
> 
> CY> terminate called after throwing an instance of 'fbl::xStreamError'
> 
> Do you catch this exception in RB? If so - why you get abort?

What Ivan says is:

* when server gone, client computer still do not have info about this.

   OS (mac and win) - still not close socket on client computer some time.
   can be up to 2 minutes it seems.
    
   So IsOpen() still answer true.

    for now we think this is the only correct behavior and you
    MUST live with this.


* Next, we do not see say you say: " Then the app quits abruptly "
    
    you have got exception from Valentina about ERR_STREAM_READ_ERROR?
    so what problems?

    of course you will get troubles if you will continue
    to use dead objects!

    The CORRECT STEP is:

        if you catch such exception, then you need
        a) want user that network server have gone.
        b) kill database objects
        c) kill Vconnection objects
        
        d) may be try create new Vconnection + Vdatabase.

YOU CANNOT reuse old Vconnection !!!



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list