From 70159b94bffaf80d00e7c27d0e2d03aa3ee20436 Mon Sep 17 00:00:00 2001 From: "Redhuan D. Oon" Date: Fri, 8 Feb 2008 19:21:31 +0000 Subject: [PATCH] left out one db.close --- base/src/org/compiere/model/MAlert.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/base/src/org/compiere/model/MAlert.java b/base/src/org/compiere/model/MAlert.java index 50b1f8cabf..6a3e7e0531 100644 --- a/base/src/org/compiere/model/MAlert.java +++ b/base/src/org/compiere/model/MAlert.java @@ -121,30 +121,23 @@ public class MAlert extends X_AD_Alert + "WHERE AD_Alert_ID=?"; ArrayList list = new ArrayList(); PreparedStatement pstmt = null; + ResultSet rs = null; try { pstmt = DB.prepareStatement (sql, null); pstmt.setInt (1, getAD_Alert_ID()); - ResultSet rs = pstmt.executeQuery (); + rs = pstmt.executeQuery (); while (rs.next ()) list.add (new MAlertRecipient (getCtx(), rs, null)); - rs.close (); - pstmt.close (); - pstmt = null; - } + } catch (Exception e) { log.log(Level.SEVERE, sql, e); } - try + finally { - if (pstmt != null) - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; + DB.close(rs, pstmt); + rs = null; pstmt = null; } // m_recipients = new MAlertRecipient[list.size ()];