Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

6.2. Better Performance

A nice side effect of keeping the persistence context valid beyond a single stateless method call is improved database performance. We already know that lazy loading results in better database performance, but we are talking about another performance improvement in a somewhat opposite direction: the reduction of database roundtrips.

A major performance problem with database-driven web applications is that many of those applications are chatty. A chatty web application saves information to the database whenever the user changes anything, as opposed to queueing database operations and executing them in a batch. Since a roundtrip to the database, potentially over the network, is much slower than a method call inside the application server, it slows down the application significantly.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint