Thread:
 Thread safety of the audit interceptor 
 RBramley   03 Nov 2006, 12:17 
 Re: Thread safety of the audit interceptor 
 s.rakesh   17 May 2007, 09:22 
 Re: Thread safety of the audit interceptor 
 singhspk   28 Sep 2008, 11:02 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: RBramley (03 Nov 2006, 12:17) Replies: 2, Views: 21662
Subject: Thread safety of the audit interceptor
I was using the sample code (plus some annotation extensions - see
above) and started getting java.util.ConcurrentModificationException 
thrown by the postFlush method when it's iterating the set of updates.

So I've added synchonisation around the Set usage - e.g.

Set<AuditLogRecord> sUpdates = Collections.synchronizedSet(updates);
synchronized(sUpdates) {
	sUpdates.add(logRecord);
}


Hopefully this will help someone else!

Robin
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]