【正文】
r extent during the execution of one of the test programs. Therefore, extent allocation will not impact the timings. Given this background, you should have a context to understand what is done in each section by each test program.AutoCommitBy default, JDBC39。ve gained 75% throughput.Table 195: OCI driver timings (in milliseconds)InsertsStatementBatched1101171,0002,804691If you examine Figure 193, a trend line analysis of the Statement object versus the batched PreparedStatement object, you39。s documentation states that you should use the OCI driver for maximum performance and the Thin driver for maximum portability. However, I remend using the Thin driver all the time. Let39。 + () + 39。 } // Create or acquire the Action instance to // process this request Action action = processActionCreate(request, response, mapping)。 processPopulate(request, response, form, mapping)。s init() method is your last chance if you want to change something in ModuleConfig, which is a collection of static configuration information that describes a Strutsbased module. Struts will freeze ModuleConfig once all PlugIns are processed. How a Request is ProcessedActionServlet is the only servlet in Struts framework, and is responsible for handling all of the requests. Whenever it receives a request, it first tries to find a subapplication for the current request. Once a subapplication is found, it creates a RequestProcessor object for that subapplication and calls its process() method by passing it HttpServletRequest and HttpServletResponse objects.The () is where most of the request processing takes place. The process() method is implemented using the Template Method design pattern, in which there is a separate method for performing each step of request processing, and all of those methods are called in sequence from the process() method. For example, there are separate methods for finding the ActionForm class associated with the current request, and checking if the current user has one of the required roles to execute action mapping. This gives us tremendous flexibility. The RequestProcessor class in the Struts distribution provides a default implementation for each of the requestprocessing steps. That means you can override only the methods that interest you, and use default implementations for rest of the methods. For example, by default Struts calls () to find out if the user has one of the roles required to execute the current ActionMapping, but if you want to query a database for this, then then all you have to do is override the processRoles() method and return true or false, based whether the user has the required role or not.First we will see how the process() method is implemented by default, and then I will explain what each method in the default RequestProcessor class does, so that you can decide what parts of request processing you want to change. public void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Wrap multipart requests with a special wrapper request = processMultipart(request)。ve saved CallableStatement objects until last, because they are the slowest performers of all the JDBC SQL execution interfaces. This may sound counterintuitive, because it39。ll get better performance if you execute your SQL statements using a Statement object instead of a PreparedStatement object. Given that, you may ask: why use a PreparedStatement at all? It turns out that there are some reasons why you might use a PreparedStatement object to execute SQL statements. First, there are several types of operations that you simply can39。ll be surprised at the reality of performance for these objects, and I hope you39。s efficiency, you can use the EXPLAIN PLAN facility to explain how the database39。s automit feature is on, which means that each SQL statement is mitted as it is executed. If more than one SQL statement is executed by your program, then a small performance increase can be achieved by turning off automit. Let39。ll see that this time, the batched PreparedStatement object bees more efficient than the Statement object at about 50 inserts. This is an improvement over the prepared statement without batching.Figure 193WARNING: There39。s take a look at some numbers from Windows 2000. Table 199 lists all the statistics we39。 for path 39。 if (action == null) { return。 } // Process any ActionForm bean related to this request ActionForm form = processActionForm(request, response, mapping)。 }}The class implementing PlugIn interface must implement two methods: init() and destroy(). init() is called when the application starts up, and destroy() is called at shutdown. Struts allows you to pass init parameters to your PlugIn class. For passing parameters, you have to create JavaBeantype setter methods in your PlugIn class for every parameter. In our HibernatePlugIn class, I wanted to pass the name of the configFile instead of hardcoding it in the application.Inform Struts about the new PlugIn by adding these lines to : strutsconfig ! Message Resources messageresources parameter= / plugin className= setproperty property=configFile value=// /plugin/strutsconfigThe className attribute is the fully qualified name of the class implementing the PlugIn interface. Add a setproperty element for every initialization parameter which you want to pass to your PlugIn class. In our example, I wanted to pass the name of the config file, so I added the setproperty element with the value of config file path. Both the Tiles and Validator frameworks use PlugIns for initialization by reading configuration files. Two more things which you can do in your PlugIn class are: If your application d