From 2b50ad637804299cec21390c85b11ff182ed15c2 Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Fri, 2 Oct 2009 10:44:18 +0000 Subject: [PATCH] merging 820955 - jdbc sync issue under high load git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-5.3@820957 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/store/jdbc/adapter/DefaultJDBCAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java index 8df17e716a..9b0b93597a 100755 --- a/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java @@ -22,11 +22,13 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.TreeSet; + import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.MessageId; import org.apache.activemq.command.SubscriptionInfo; @@ -55,7 +57,7 @@ public class DefaultJDBCAdapter implements JDBCAdapter { private static final Log LOG = LogFactory.getLog(DefaultJDBCAdapter.class); protected Statements statements; protected boolean batchStatments = true; - private Set lastRecoveredMessagesIds = new TreeSet(); + private Set lastRecoveredMessagesIds = Collections.synchronizedSet(new TreeSet()); protected void setBinaryData(PreparedStatement s, int index, byte data[]) throws SQLException { s.setBytes(index, data);