synchronize the asyncWrite method. To avoid the following reported stack trace:

Running org.apache.activemq.broker.region.cursors.CursorDurableTest
Exception in thread "Persistence Adaptor Task" java.lang.NullPointerException
        at org.apache.activemq.store.amq.AMQMessageStore$4.execute(AMQMessageStore.java:381)
        at org.apache.activemq.util.TransactionTemplate.run(TransactionTemplate.java:44)
        at org.apache.activemq.store.amq.AMQMessageStore.doAsyncWrite(AMQMessageStore.java:374)
        at org.apache.activemq.store.amq.AMQMessageStore.asyncWrite(AMQMessageStore.java:341)
        at org.apache.activemq.store.amq.AMQMessageStore$1.iterate(AMQMessageStore.java:95)
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
        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:595)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 303.672 sec <<< FAILURE!

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@650956 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-04-23 17:46:05 +00:00
parent cbb290c0b3
commit 347f8eca1b
1 changed files with 1 additions and 1 deletions

View File

@ -328,7 +328,7 @@ public class AMQMessageStore implements MessageStore {
* @return
* @throws IOException
*/
void asyncWrite() {
synchronized void asyncWrite() {
try {
CountDownLatch countDown;
lock.lock();