|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON Java Industry News
High-Performance Batch Processing with Java Enterprise Edition
The benefits
By: Colin Hendricks
Aug. 13, 2007 06:00 AM
Digg This!
Page 1 of 3
next page »
Enterprise software developers and corporate IT architects have established the Java Enterprise Edition (JEE) platform as a leading choice for building enterprise software applications. The platform is widely used for everything from eCommerce Websites to back office data aggregation systems. Its versatility and reliability as an enterprise computing platform is well established. But this wasn't always so. Sun initially trumpeted Java as a desktop platform that would bring rich content to Web applications in the form of Java applets that run locally in a user's Web browser. It was also touted as a thick-client desktop application development tool that would be widely used to build applications that could run on any computer (remember write once, run anywhere?). Sometime in the late nineties, Java application development took a 90 degree turn and ended up resulting in software that mostly runs on corporate servers instead of corporate workstations. Today, a substantial portion of Web applications are delivered on the JEE platform. Despite the "Enterprise" in its name, the JEE platform was principally designed for handling HTTP requests from Web browsers and performing some business logic in response to each request. It now includes many other technologies, but most of them are related to this mission. However, as the complexity and disparate uses of Web applications has grown, users and designers of these systems have found many users for JEE beyond just responding to requests from a browser. Many of these uses include common enterprise back office tasks such as batch processing of large volumes of data, and while the JEE platform was not originally designed for such purposes, it is versatile enough to provide viable solutions to these problems.
What Is a Batch?
The characteristics of the typical batch process include:
Why Do Batch Processing in JEE? However, this limitation can be overcome in a couple ways. First, while most JEE containers discourage developers from creating and managing their own threads, they do not prohibit the practice, especially outside the bounds of EJB classes. Therefore, the batch process can do its own threading using the java.util.Concurrent package (available as of Java 5) and on most JEE platforms this causes no trouble. This package provides user-friendly thread pool classes and thread management facilities that make it easier than ever to create multi-threaded applications in Java. Second, a more spec-compliant approach to multithreading is to use Java Message Service (JMS) messages to create worker threads within the JEE context. This approach is a little more complex to implement but provides the benefits of complying with the JEE specification while also allowing the batch process to span multiple Java Virtual Machine (JVM) instances in a clustering situation. This will be discussed in more detail below. Another issue with batch processing on the JEE platform is that by default the container manages transactions and session timeouts. The JEE container is inclined to limit how long resources such as database connections, transactions and beans can be monopolized. This is meant to guarantee a high level of service to all users within an online application, but can be problematic for a long-running batch process. This issue can be addressed by correctly configuring a batch process not to require JEE transactions and to avoid the use of entity beans and stateful session beans that might have timeout or locking problems. Also, be sure to use the pooled resources such as database connections judiciously, releasing them back to the pool when not in use. In addition to these limitations there is a performance question. Other methods can achieve higher performance than the JEE platform. Batch processing typically involves operations on large volumes of rows stored in a relational database, and a stored procedure implemented directly in the database might offer the fastest performance for most applications. However, there are legitimate reasons to implement the logic in JEE instead.
• Stored procedures are typically implemented in the version of SQL specific to the database platform and are not portable to other databases. This may not matter for a departmental application but is usually not acceptable for an enterprise software product that must be supported on many different databases. These benefits will often outweigh any performance gain that might be achieved using stored procedures. Furthermore, the difference in performance between a Java solution and a database stored procedure solution can be minimized using the techniques described below.
Techniques for High-Performance Batch Processing on JEE Page 1 of 3 next page » SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
LATEST JAVA STORIES & POSTS
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
|
MOST READ THIS WEEK TODAY'S TOP LINKS YOU MUST CLICK ON ! BREAKING JAVA NEWS
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||