https://issues.apache.org/jira/browse/AMQ-5984 - fix sync on get for access ordered LinkedHashMap

This commit is contained in:
gtully 2015-09-28 13:57:30 +01:00
parent 4a8fec4a66
commit f6e1054a4b
1 changed files with 2 additions and 2 deletions

View File

@ -1116,11 +1116,11 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
@Override @Override
public long getLastProducerSequenceId(ProducerId id) { public long getLastProducerSequenceId(ProducerId id) {
indexLock.readLock().lock(); indexLock.writeLock().lock();
try { try {
return metadata.producerSequenceIdTracker.getLastSeqId(id); return metadata.producerSequenceIdTracker.getLastSeqId(id);
} finally { } finally {
indexLock.readLock().unlock(); indexLock.writeLock().unlock();
} }
} }