-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Method with @NotSupported executes slower
PostPosted: Mon May 17, 2010 10:04 am 
Newbie

Joined: Mon May 17, 2010 9:33 am
Posts: 1
Hi!
I use Hibernate 3.3.1 with JPA/EJB3/Glassfish/JBoss Cache. There was an idea than making read only method of stateless session bean (for example findById(...)) annotated by @NotSupported or @Supports will make it faster than with default transaction attribute @Requires.
Surprisingly, annotating method with @NotSupported made its execution much slower (1500 msec vs 120 ms)!
I tried to disable second level cache (JBoss cache), it doesn't help.
Profiling my application I found that method findById() have several hundreds of calls to JoinableCMTTransaction.isTransactionInProgress() method that slows up the execution of method.
Also I add
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
to my persistence.xml, it doesn't help too.

Code:
@Stateless
public class CompanyServiceBean implements CompanyService {
...
@PersistenceContext
private EntityManager em;
...
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public Company findWithNotSupported(Long id) {
Company res = em.find(Company.class, id); // executes 1500 ms
return res;
}
...
@TransactionAttribute(TransactionAttributeType.REQUIRES)
public Company findWithRequires(Long id) {
Company res = em.find(Company.class, id); // executes 120 ms
return res;
}
...

What can be wrong in my application?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.