Problem with re-connecting to Firebird database
Posted: Wed 27 Jul 2011 18:20
I use UniDAC to work with Firebird database. If a connection is lost (weak signal in wireless network or just cable removed for a moment) I can not reconnect to database.
For example:
1. I remove cable
2. I try to open UniQuery.
Now instead of OnConnectionLost I receive exception "Can't perform operation on a closed dataset" (TUniConnection.Options.LocailFailover set to True and DisconnectMode also set to True, but all combinations tested).
3. I stick the cable to computer again and press Ok.
In the program (exception handling) I try to Disconnect and Connect again, because UniConnection flag is still set to True.
4. When I try again to OpenQuery I receive a message:
Can't perform operation on active transaction.
I tried to manually StartTransaction, Rollback, Commit and so on.
The only other result I get is a message:
invalid transaction handle (expecting explicit transaction start)
How to reconnect to the database after temporary network problems?
For example:
1. I remove cable
2. I try to open UniQuery.
Now instead of OnConnectionLost I receive exception "Can't perform operation on a closed dataset" (TUniConnection.Options.LocailFailover set to True and DisconnectMode also set to True, but all combinations tested).
3. I stick the cable to computer again and press Ok.
In the program (exception handling) I try to Disconnect and Connect again, because UniConnection flag is still set to True.
4. When I try again to OpenQuery I receive a message:
Can't perform operation on active transaction.
I tried to manually StartTransaction, Rollback, Commit and so on.
The only other result I get is a message:
invalid transaction handle (expecting explicit transaction start)
How to reconnect to the database after temporary network problems?