Commits

hani  committed 57ba8f6
  • Participants
  • Parent commits b20b4ce

Comments (0)

Files changed (1)

File src/java/com/opensymphony/module/propertyset/database/JDBCPropertySet.java

             setValues(ps, type, key, value);
 
             int rows = ps.executeUpdate();
-            ps.close();
 
             if (rows != 1) {
                 // ok, this is a new value, insert it
                 sql = "INSERT INTO " + tableName + " (" + colString + ", " + colDate + ", " + colData + ", " + colFloat + ", " + colNumber + ", " + colItemType + ", " + colGlobalKey + ", " + colItemKey + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
+                ps.close();  // previous ps, before reassigning reference.
                 ps = conn.prepareStatement(sql);
                 setValues(ps, type, key, value);
                 ps.executeUpdate();