Yes. Ok, I understand but I try to explain better.

This is my simple code:

...
for(;;)
{
        try
        {
                using(FbConnection tFbConn = new FbConnection(...))
                {
                        try
                        {
                                tFbConn.Open();
                                if(ConnectionState.Open == tFbConn.State)
                                {
                                        bConnOpen = true;
                                }
                        } // try
                        catch(ArgumentException tArgExcept)
                        {
                                ...
                                bConnOpen = false;
                        } // catch(ArgumentException tArgExcept)
                        catch(FbException tFbExcept)
                        {
                                ...
                                bConnOpen = false;
                        } // catch(FbException tFbExcept)
                        finally
                        {
                                tFbConn.Close();
                        } // finally
                } // using(FbConnection tFbConn = new 
FbConnection(Program.strFirebirdConnStr))
        } // try
        catch(Exception tExcept)
        {
                ...
                bConnOpen = false;
        } // catch(Exception tExcept)
        finally
        {
                ...
        } // finally
        Thread.Sleep(1000);
} // for(;;)
...

I try continuously to connect towards Firebird because I've created a Loop, the 
right sequence is this
1 Firebird service ON
2 Execute my program and recognizes Database connection OK (right...)
3 Stop the Firebird service by Firebird Service Control.
4 My program is still ON and recognizes Database connection NOT OK (right...)
5 Restart the Firebird service by Firebird Service Control
6 My program is still ON and recognizes Database connection OK again (right...)
7 so on...

the strange sequence is this:
1 Firebird service OFF
2 Execute my program and recognizes Database connection NOT OK (right...)
3 Restart the Firebird service by Firebird Service Control
4 My program is still ON and recognizes Database connection NOT OK (wrong...)
5 Stop the Firebird service by Firebird Service Control
6 My program is still ON and recognizes Database connection NOT OK (right or 
wrong?)
7 so on...

Why doesn't FbConnection (after calling Open method) reconnect to Firebird 
server in this last sequence?

Thanks
Giulio


-----Messaggio originale-----
Da: Jiri Cincura [mailto:disk...@cincura.net]
Inviato: venerdì 24 aprile 2009 11.52
A: For users and developers of the Firebird .NET providers
Oggetto: Re: [Firebird-net-provider] Reliable connection


On Fri, Apr 24, 2009 at 11:35, Sporti Giulio <giulio.spo...@bottero.com> wrote:
> It seems that FbConnection doesn't try to open the connection towards
> Firebird server.

Of course. You have to open connection yourself.

-- 
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to