Unanswered: How To Detect A Disconnection In Occi ?
I'm wondering how to detect a disconnection in OCCI (Oracle C++ Call Interface). There is a method in JDBC to know if the connection to Oracle is still active, but no such method is spoken of in the Oracle OCCI documentation. Does one exist ? Is there another way to do that ? (I've thought of catching an SQLException, checking its error code, and decide whether or not I'll have to try to reconnect, but I'd sincerely like an easier way. Timeouts wouldn't be a solution).
Google does not help at all on that matter : a search on "detect OCCI disconnection" only gives 5 useless results, while one on "OCCI disconnection" barely gives more than 10 results, only the first being useful, giving access to an Oracle Documentation on OCCI, but even this one does not help. I had already read the sections of "Oracle C++ Call Interface Programmer’s Guide" that could be useful to me on that matter, but found nothing. The problem is that I want my program to run continuously, possibly without any stop, and I would want it to detect when there is a problem with the connection to the Oracle Server, wait until the problem is solved, and reconnect, without having to stop and start my program again. As I've already said, I've thought about catching the exception, check if this may be an exception caused by a disconnection, and in that case try to reconnect (by looping on "connect try / sleep"). Has anyone a simpler and/or more elegant idea ?
Right, I did not notice this one, because I don't use a Shared Pool. However, this method only gives the number of opened connections in the shared pool : I would not be able to know which connection is down. Thanks anyway. If you go on developing in OCCI and find out an easy way to detect a disconnection, please let me know !