From: Daniel O'N. <do...@ri...> - 2011-02-16 21:59:58
|
I'm curious if there's a way to disconnect a dbi_conn without destroying the handle in the process? The Ferite Libdbi interface works on a 'connect or die' system, something like this: object dbh = Dbi.connect("mysql", "localhost", "root"); if( !dbh ) { // Failed to connect } else { // Connected } At the moment, I am attempting to modify this to allow, for example: object dbh = new Dbi(); dbh.connect("mysql", "localhost", "root"); if( !dbh.connected() ) { println( dbh.errmsg() ); } Then, freely dbh.close() and dbh.open() later on. The trouble is I can't figure out a way to close the connection without destroying the underlying dbi_conn handle. If there isn't currently a way, would a patch implementing, for example, a "dbi_conn_disconnect(dbi_conn Conn)" be considered? |