Adam Bien's Weblog

The Cost Of An "Empty" Transaction--Screencast

Is it worth to disable transaction (with e.g. @TransactionAttribute(TransactionAttributeType.NEVER)) on an EJB method for optimization purposes? Such micro-optimizations increase the complexity, but what is the actual benefit?

In this following screencast a Servlet was deployed with and without involving a UserTransaction and the performance difference was measured with JMeter.

Thanks for watching!

See also other screencasts at: or subscribe to

See you at Java EE Workshops at MUC Airport!

NEW dates, new workshop: Java EE 7 Workshops: Bootstrap, Effective, Architectures, JavaScript Bootstrap and HTML 5 December, 7th-11th
NEW: Effective Java EE 7 -- Available For Streaming


A book about rethinking Java EE Patterns


Hi Adam
Thanks for the video.

I have a question on JVM optimization for the transactions in this scenario.

You say that the second time the test ran it is a little bit faster and it might be that the JVM is optimized. Can you explain more? Because you changed code (added transaction) and redeployed?

Will it be a different scenario if you cleaned out the app from glassfish and redeploy?

Posted by Rentius on August 13, 2013 at 12:20 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments