Arnas Tre?iokas

Database object connection losses in Blaze

Discussion created by Arnas Tre?iokas on Sep 2, 2010
Latest reply on Oct 7, 2010 by Arnas Tre?iokas

I have an issue with Blaze Advisor database objects. I have several database objects in my project. When the deployed service starts, everything works fine, database objects automatically connects to database and gets data using static method getAllInstances(). 


Problem appears when computer with the service disconnects from the remote database and connects again. Calling getAllInstances() with database object raises the exception, that connection was closed. Checking database object state, isConnected() method returns true. Trying to close connection on the exception with disconnect() method, raises same exception, that connection was closed. Trying to connect again, on the exception with connect() method, raises the exception, that already connected. The only way to connect to database again is to restart service or reset agent. But this must be done on the service side, not in the repository.


I even have tried to getConnectionInfo() on the exception from the database object and have set this object (DbConnectionInfo) to that database object again with the setConnectionInfo(). This did the trick, database object reconnected to database, as soon as physical connection between machines was established. But after such new connection the old connection left zombie process in the database, which doesn't disappears after service is closed. 


Is any way to correctly handle database objects in Blaze? What need to be done, to reconnect to database automatically, after connection was lost.