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: s.rakesh (17 May 2007, 09:22) Replies: 1, Views: 6649
Subject: Re: Thread safety of the audit interceptor
POST QUESTIONS ON THE FORUM! COMMENTS HERE SHOULD ADD VALUE TO THE PAGE!
On 03 Nov 2006 12:17, RBramley wrote:

>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

I'm facing same problem.I made what you suggested but it is not working.
As AuditLogInterceptor bean is not singleton,it is instantiating per 
request(means it is threadsafe).In such conditions 
ConcurrentModificationException is very odd.

If you have any idea please reply.

Thanks,
s.rakesh
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]