[seam-dev] Re: Blocked threads

Christian Bauer cbauer at redhat.com
Thu Jun 5 07:17:02 EDT 2008


>
> All of this needs more testing, this is just some quick hack.  
> Basically, try to find the guys who call Transaction.instance() more  
> than once (or twice) during a request.

These are the changes I made in Component.java:

        if ( getType()==JAVA_BEAN &&  
beanClassHasAnnotation(Transactional.class))
        {
-         addInterceptor( new Interceptor( new  
TransactionInterceptor(), this ) );
+         // TODO: PERFORMANCE ISSUE! addInterceptor( new  
Interceptor( new TransactionInterceptor(), this ) );
        }
        if ( getScope()==CONVERSATION )
        {
-         addInterceptor( new Interceptor( new  
ManagedEntityIdentityInterceptor(), this ) );
+         // TODO: PERFORMANCE ISSUE! addInterceptor( new  
Interceptor( new ManagedEntityIdentityInterceptor(), this ) );
        }

And in my EntityHome extensions:

public class UserHome extends EntityHome<User> {
     protected void joinTransaction() {
         // NOOP
     }
}

Attached are two samples, one with Seam compiled from trunk, one with  
my hacks.

The other blocking operation I noticed (and mentioned in an earlier e- 
mail) is java.lang.reflect.AccessibleObject.isAnnotationPresent(),  
which I think is synchronizing on a HashMap. We have a few situations  
where this method is called in loops during a request (again with  
ManagedEntityIdentityInterceptor the main culprit)- which is  
absolutely unnecessary. So someone with the JDK 5.0 source code needs  
to look at this.

Marek and Jay, now it's your turn, please get going.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: result_hacked_seam.png
Type: image/png
Size: 13248 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/seam-dev/attachments/20080605/524ce82c/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: result_trunk_seam.png
Type: image/png
Size: 12395 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/seam-dev/attachments/20080605/524ce82c/attachment-0001.png 


More information about the seam-dev mailing list