rollback « Connection « Java Database Q&A





1. Does Java Connection.close rollback?    stackoverflow.com

Does Java Connection.close rollback into a finally block?. I know .Net SqlConnection.close does it. With this I could make try/finally blocks without catch... Example:

try {
    conn.setAutoCommit(false);
    ResultSet rs ...

2. When should we call connection.rollback() method?    stackoverflow.com

Please let me know when do we require to call the method connection.rollback();

try{
  connection = getConnection();
  connection.setAutoCommit(false);
  pstmt1 = connection.preparedstatement ( ... );
  ...
  pstt1.executeUpdate();
  ...

3. Is rollback needed if java.sql.Connection#commit() throws exception?    stackoverflow.com

According to JAVA documentation, Connection#commit() can throw SQLException. My question is whether or not a rollback should still be issued in this scenario. For example:

Connection con = null;
try {
  ...

4. Java, JDBC connection pool, JDBC connection rollback    stackoverflow.com

We have a database connection pool (java JDBC). Every time we checkout, we first do preemptive connection rollback to avoid connection exceptions. Please ignore the business case. Just from technical ...

6. How can I rollback when connection close?    coderanch.com

I work with Oracle (jbdc) in web developpment. Presently with java, when we close the Oracle Connection, a commit is made automatically. I want to change it to an automatic rollback when I close the connection (myConn.lose() ). The reason is when a user submits a form (in the browser) and he clicks the stop button before the process is terminated, ...

7. connection rollback/ atomic transaction problem    coderanch.com

Hi, I have a problem. I am using JSF1.1, EJB2.x, JDBC and weblogic8.1sp6. the structure of the application is like this, jsf bean calls facade bean(which is stateless session bean) method. facade bean method calls dao method to perform database insert/updates. the trasaction attribute of facadebean's method is set to required in ejb-jar.xml. now I create connection in the dao method ...