Autocommit problem

From: "mp(dot)rajkhowa" <mp(dot)rajkhowa(at)nic(dot)in>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Autocommit problem
Date: 2008-01-09 06:56:02
Message-ID: 28d149eed22d122.4784b652@nic.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


hello

i am developing an applicationusing tomcat 5.5.6 and postgrsql7.3 (pg73jdbc3.jar) deployedinRedHat linux. Three days earlier updatedacolumn of particular row in a table . When iretrieved thesame row from the JSP page it was showingOK.Even when i run theselect statement for the row inpostgresql console it wasshowing updated value. Buttoday that means after 3 days when i try to viewthe row it is showing the oldvalueforthe row. When i run the select statement for the rowinposgresql console it is showing the old value. How can ithappen?Can you please help me out. My java code for theupdation isshown below.....

String sql = "UPDATE ........";
Connectioncon =DBConnection.getConnection(); // DBConnectio is aclass forgetting theconnection
Statement stmt = con.createStatement();
// Update a row
try {
con.setAutoCommit(false);
int rowsUpdated = stmt.executeUpdate(sql);
if (rowsUpdated != 1) {
System.out.println("Success");
}
con.commit();
}
finally {
stmt.close();
}

with regards
Mridu Pobon Rajkhowa

Browse pgsql-jdbc by date

  From Date Subject
Next Message Moien 2008-01-09 08:50:33 How to Install PostgerSQL_Driver ( in tomcat ) ?
Previous Message Håkan Jacobsson 2008-01-08 20:37:52 Re: JBoss-related question