Search This Blog

12 February 2009

WTF worthy man page suggestion...

I encountered the following text in a man page. Please tell me that I am not alone in thinking that the "typical" solution suggested is WTF worthy...

After calling "commit" or "rollback" many drivers will not let you
fetch from a previously active "SELECT" statement handle that's a child
of the same database handle. A typical way round this is to connect the
the database twice and use one connection for "SELECT" statements.


If the programmer really wants to reuse values from a SELECT statement which occurred within a transaction after the transaction is closed, they should cache those values themselves by populating some variable within their application. IMO, they definitely should not be using multiple connections to the same database from one unit of work unless they are perfectly happy to accept inconsistent data and potentially corrupted inserts and updates.

No wonder many software developers are so confused when supposedly "authoritative" manuals give them screwball advice.

1 comment:

Sheeri K. Cabral said...

You have seen www.dbawtf.com, right? (you can post anonymously)