[
https://issues.apache.org/activemq/browse/AMQ-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47239#action_47239
]
Chris Pettitt commented on AMQ-1430:
------------------------------------
I ran into this issue with ActiveMQ in the 4.1.1 branch and found that it had
been fixed in changeset 646880 (I manually bisected about 12 changesets to find
this).
The brokerSequenceId for a Message is used as its unique identifier in the
persistence store. In code preceding 646880 the brokerSequenceId is never
changed for a message after it has been copied (as by CompositeQueue), so it is
possible to have an ID collision in the database. 646880 resolved this by
setting a new brokerSequenceId (the regionBroker's sequence ID) immediately
before sending the message to the persistence store in the Queue (and Topic)
class.
> Composite Queue causes duplicate keys in JDBC store
> ---------------------------------------------------
>
> Key: AMQ-1430
> URL: https://issues.apache.org/activemq/browse/AMQ-1430
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker
> Environment: apache-activemq-5.0-20070920.154726-5, JVM 1.5.0_07, Mac
> OS X
> Reporter: David Dossot
> Fix For: 5.3.0
>
>
> Using this CQ config:
> <compositeQueue name="A">
> <forwardTo>
> <queue physicalName="B"
> />
> <queue physicalName="C"
> />
> </forwardTo>
> </compositeQueue>
> and this JDBC config:
> <journaledJDBC journalLogFiles="5"
> dataDirectory="${esb.data.dir}/activemq/data"
> dataSource="#derby-ds" />
> I create a subscriber to queue B and one to queue C. I start a publisher that
> sends 20 messages.
> The subscriber to queue B receives 20 messages ; the one on queue C receives
> 0.
> The server prints this error for each message:
> Sep 20, 2007 1:11:04 PM org.apache.activemq.util.TransactionTemplate run
> SEVERE: Having to Rollback - caught an exception: java.io.IOException: The
> statement was aborted because it would have caused a duplicate key value in a
> unique or primary key constraint or unique index identified by
> 'SQL070920011040920' defined on 'ACTIVEMQ_MSGS'.
> Sep 20, 2007 1:11:04 PM
> org.apache.activemq.store.journal.JournalPersistenceAdapter doCheckpoint
> SEVERE: Failed to checkpoint a message store:
> java.util.concurrent.ExecutionException: java.io.IOException: Not started.
> java.util.concurrent.ExecutionException: java.io.IOException: Not started.
> at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
> at java.util.concurrent.FutureTask.get(FutureTask.java:80)
> at
> org.apache.activemq.store.journal.JournalPersistenceAdapter.doCheckpoint(JournalPersistenceAdapter.java:397)
> at
> org.apache.activemq.store.journal.JournalPersistenceAdapter$1.iterate(JournalPersistenceAdapter.java:118)
> at
> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:118)
> at
> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:42)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:613)
> Caused by: java.io.IOException: Not started.
> at
> org.apache.activemq.store.jdbc.TransactionContext.rollback(TransactionContext.java:174)
> at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.rollbackTransaction(JDBCPersistenceAdapter.java:366)
> at
> org.apache.activemq.store.journal.JournalPersistenceAdapter.rollbackTransaction(JournalPersistenceAdapter.java:200)
> at
> org.apache.activemq.util.TransactionTemplate.run(TransactionTemplate.java:59)
> at
> org.apache.activemq.store.journal.JournalMessageStore.checkpoint(JournalMessageStore.java:257)
> at
> org.apache.activemq.store.journal.JournalMessageStore.checkpoint(JournalMessageStore.java:232)
> at
> org.apache.activemq.store.journal.JournalPersistenceAdapter$4.call(JournalPersistenceAdapter.java:367)
> at
> org.apache.activemq.store.journal.JournalPersistenceAdapter$4.call(JournalPersistenceAdapter.java:366)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> ... 3 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.