Re: [IBPP-DISCUSS] Sql Code 902, Engine Code 335544856
IBPP is a C++ client class library for FirebirdSQL
Status: Inactive
Brought to you by:
epocman
From: Kelly, R. <Rut...@dm...> - 2012-05-23 08:47:50
|
Hi Oliver, Thanks for the reply. The firebird log shows no indication of a server shutdown until immediately after the sql error has occurred. Aside from that, the software already handles engine code 335544528 for database shutdowns, and engine code 335544721 which is a network error and which we have found to be generated by a server shutdown (crash or normal shutdown). When handling these two error codes, the software deletes the existing database objects and attempts to reconnect with new database objects - if the reconnect fails after 3 attempts then the application exits. I would therefore assume that if the reconnect succeeds, then when I run a check to ensure that my database object is a) valid (i.e. not a null pointer) and b) connected (i.e. returning true from the IBPP::Connected call on the database object) before actioning my transaction, if these two conditions are met then the transaction should run with no errors. Also, after a reconnect the software does not attempt to carry on with the transaction on which the error occurred so there is no issue caused by invalid transaction and statement objects. I have so far not managed to generate error code 335544856 during testing as manually shutting down the server (either using fbmgr -shut to simulate a normal shutdown or killing the thread to simulate a crash) always generates code 335544721 which then triggers the reconnect mechanism as described above. This error code is generated even if I simulate the server shutdown occurring after the database object validity and connection have been checked and before the statement has been executed. I can easily modify the software to handle error code 335544856 in the same way as the other two error codes (i.e. triggering the reconnect mechanism with new database objects), but if possible I would like to know what is likely to cause this particular error code to be generated so that I can test my software modification properly and see if there are any underlying issues which also need to be addressed. Ruth -----Original Message----- From: Olivier Mascia [mailto:om...@ti...] Sent: 22 May 2012 21:27 To: ibp...@li... Subject: Re: [IBPP-DISCUSS] Sql Code 902, Engine Code 335544856 Ruth, Valid and connected, for what regards known state from the application point of view. If the server has been disconnected (or stopped / restarted) the application (through IBPP) will only pick that up on the next attempt to do a real operation: your Prepare(). Can you check the server logs and confirms that the server was restarted or the DB shutdown, or something, between the time you obtained your Database, Transaction and Statement object, and the time you run the Prepare() or Execute()? If that is something you can encounter at any time, you will have to work around it, catch the exception and organizing a reconnection - obtaining a new Database connection, Transaction, Statement, ... Other mailing-list members: any other idea? Thanks all, - Olivier Mascia Le 22 mai 2012 à 08:35, Kelly, Ruth a écrit : > As far as I can tell, the code checks that the IBPP database object is both valid and connected to ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ ibpp-discuss mailing list Post to ibp...@li... Settings https://lists.sourceforge.net/lists/listinfo/ibpp-discuss http://www.ibpp.org |