Commit a6042a79 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Do not close an already closed statement. This may trigger an error when using...

Do not close an already closed statement. This may trigger an error when using Sybase jdbc driver. JM-570

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3479 b35dd754-fafc-0310-a699-88a17e54d16e
parent 93d51a8b
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
package org.jivesoftware.wildfire.group; package org.jivesoftware.wildfire.group;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.XMPPServer;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import java.sql.Connection; import java.sql.Connection;
...@@ -198,7 +198,6 @@ public class DefaultGroupProvider implements GroupProvider { ...@@ -198,7 +198,6 @@ public class DefaultGroupProvider implements GroupProvider {
pstmt = con.prepareStatement(DELETE_GROUP); pstmt = con.prepareStatement(DELETE_GROUP);
pstmt.setString(1, groupName); pstmt.setString(1, groupName);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close();
} }
catch (SQLException e) { catch (SQLException e) {
Log.error(e); Log.error(e);
......
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
package org.jivesoftware.wildfire.muc.spi; package org.jivesoftware.wildfire.muc.spi;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.*;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.StringUtils;
import org.jivesoftware.wildfire.PacketRouter;
import org.jivesoftware.wildfire.muc.MUCRole; import org.jivesoftware.wildfire.muc.MUCRole;
import org.jivesoftware.wildfire.muc.MUCRoom; import org.jivesoftware.wildfire.muc.MUCRoom;
import org.jivesoftware.wildfire.muc.MultiUserChatServer; import org.jivesoftware.wildfire.muc.MultiUserChatServer;
import org.jivesoftware.wildfire.PacketRouter;
import org.jivesoftware.util.Log; import java.sql.Connection;
import org.jivesoftware.util.StringUtils; import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
/** /**
* A manager responsible for ensuring room persistence. There are different ways to make a room * A manager responsible for ensuring room persistence. There are different ways to make a room
...@@ -126,7 +126,6 @@ public class MUCPersistenceManager { ...@@ -126,7 +126,6 @@ public class MUCPersistenceManager {
answer = rs.getString(1); answer = rs.getString(1);
} }
rs.close(); rs.close();
pstmt.close();
} }
catch (SQLException sqle) { catch (SQLException sqle) {
Log.error(sqle); Log.error(sqle);
......
...@@ -304,6 +304,9 @@ public class RosterItemProvider { ...@@ -304,6 +304,9 @@ public class RosterItemProvider {
// Close the statement and result set // Close the statement and result set
pstmt.close(); pstmt.close();
rs.close(); rs.close();
// Set null to pstmt to be sure that it's not closed twice. It seems that
// Sybase driver is raising an error when trying to close an alrady closed statement.
pstmt = null;
// Load the groups for the loaded contact // Load the groups for the loaded contact
for (RosterItem item : itemList) { for (RosterItem item : itemList) {
......
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