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.