rollback « Connection « Java Database Q&A

Home
Java Database Q&A
1.Blob
2.cassandra
3.column
4.Connection
5.Cursor
6.dao
7.Data Type
8.Database
9.Database Product
10.DataSource
11.Date
12.db2
13.derby
14.Development
15.Driver
16.Exception
17.file
18.hadoop
19.hbase
20.hsqldb
21.ibatis
22.JDBC
23.memcached
24.mongodb
25.MS Access
26.mysql
27.ODBC
28.Operation
29.oracle
30.postgresql
31.Record
32.result
33.Resultset
34.Schema
35.SQL
36.sqlite
37.SQLserver
38.Statement
39.stored procedure
40.sybase
41.Table
42.Transaction
43.Trigger
Java Database Q&A » Connection » rollback 

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 ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.