IDEMPIERE-2649 Not properly closed ResultSet in M_PriceList_Create

This commit is contained in:
tsvikruha 2015-07-01 19:59:37 -05:00
parent 821c8c3f5e
commit 27588c7801
1 changed files with 55 additions and 45 deletions

View File

@ -685,8 +685,12 @@ public class M_PriceList_Create extends SvrProcess {
sqlpc.append(" WHERE s.T_Selection_ID=p.M_Product_ID");
sqlpc.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID + ")");
PreparedStatement ps = DB.prepareStatement(sqlpc.toString(), get_TrxName());
ResultSet rs = ps.executeQuery();
PreparedStatement ps = null;
ResultSet rs = null;
try{
ps = DB.prepareStatement(sqlpc.toString(), get_TrxName());
rs = ps.executeQuery();
while(rs.next())
{
int M_Product_ID = rs.getInt(MProductPrice.COLUMNNAME_M_Product_ID);
@ -734,6 +738,12 @@ public class M_PriceList_Create extends SvrProcess {
if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu);
}
}
} catch (SQLException e) {
throw e;
} finally {
DB.close(rs, ps);
rs = null; ps = null;
}
}
//