Commit 6275ae0b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

1) Fixed closed of incorrect statement

2) Modified to use a second connection for nested statements


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@692 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8eb6fd60
......@@ -299,10 +299,11 @@ public class RosterItemProvider {
RosterItem.RecvType.getTypeFromInt(rs.getInt(5)),
rs.getString(6),
null);
Connection con2 = DbConnectionManager.getConnection();
PreparedStatement gstmt = null;
ResultSet gs = null;
try {
gstmt = con.prepareStatement(LOAD_ROSTER_ITEM_GROUPS);
gstmt = con2.prepareStatement(LOAD_ROSTER_ITEM_GROUPS);
gstmt.setLong(1, item.getID());
gs = gstmt.executeQuery();
while (gs.next()) {
......@@ -311,9 +312,9 @@ public class RosterItemProvider {
itemList.add(item);
}
finally {
try { if (pstmt != null) { pstmt.close(); } }
try { if (gstmt != null) { gstmt.close(); } }
catch (Exception e) { Log.error(e); }
try { if (con != null) { con.close(); } }
try { if (con2 != null) { con2.close(); } }
catch (Exception e) { Log.error(e); }
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment