Suppose i obtain a Connection from a Connection Pool (through a DataSource). I release the Connection to the pool by calling con.close(). Note that close() doesn't actually close the Connection but merely releases it to the pool. Now, what will happen if i call con.rollback() (or any other method, for that matter) on the Connection. Please respond ASAP. Thanks in advance.
If you ready the API you find: "Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled."
Sorry ... tired .... probably you get a SQLException ... you may look at some Connection real implementation to see exactly what happens. I checked within Sybase Connection implementation and their before trying to execute rollback checks the connection and throws an exception.