Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Managing pureQuery-enabled applications efficiently, Part 3: Automate client optimization with WebSphere applications

pureQuery client optimization with SQL management repository

Tony Sun (tonysun@us.ibm.com), Staff Software Engineer, IBM
Tony Sun is the primary QA engineer for the pureQuery runtime product.

Summary:  In a customer environment, applications often interact with transactional databases from within an application server. pureQuery client optimization can provide useful diagnostic information as well as increase performance for your web application. In this tutorial, you will learn how to automate the pureQuery client optimization process with Apache Ant script technologies.

View more content in this series

Date:  19 May 2011
Level:  Intermediate PDF:  A4 and Letter (1033 KB | 24 pages)Get Adobe® Reader®

Activity:  17116 views
Comments:  

Customizing the automation process

The automated process you have learned to run is a default set of Ant script tasks. As mentioned, the benefit of this framework is its versatility. To customize these scripts for your needs, you need to understand what the default set of tasks are doing. The following tasks are all the tasks that can be configured and reside within the Ant script repository.xml.

Repository setup tasks

These tasks are similar to the setup repository tasks you learned in Part 1. However, they progress a few steps further by creating a runtime group, uploading the necessary runtime group artifacts, and activating the runtime group.


Listing 2. Set up repository
        
<target name="setup_repository">
	<echo message="Setup the repository." />
	<antcall target="delete_repository"/
	<antcall target="create_repository"/>
	<antcall target="create_runtimegroup"/>
	<copy file="${repository.uploadFolder}/pdqdynamic.properties" 
	tofile="${repository.uploadFolder}/pdq.properties"/>
	<antcall target="update_runtimegroup_setup"/>
	<antcall target="activate_runtimegroup"/>
</target>

As you can see, the primary tasks comprise smaller subtasks. To customize this task, you can add or remove any of the subtasks within the <target> and </target> headers. For instance, suppose you have already created your repository and need to create only a runtime group. You can remove the delete_repository and create_repository tasks. Your new Setup_Repository task becomes:


Listing 3. Set up creating runtime group only
        
<target name="setup_repository">
	<echo message="Setup only runtimegroup." />
	<antcall target="create_runtimegroup"/>
	<copy file="${repository.uploadFolder}/
	pdqdynamic.properties" 
	tofile="${repository.uploadFolder}/pdq.properties"/>
	<antcall target="update_runtimegroup_setup"/>
	<antcall target="activate_runtimegroup"/>
</target>


Launching application and client optimization

This task launches the application deployed in WebSphere while simultaneously starting the client optimization process for the application.


Listing 4. Run application
        
<target name="runapp">
	<echo message="Run parallel application while capturing,merging,configure,bind" />
	<parallel>
	<get src="${application.url}" dest="${repository.http.request}/save.html}"/>
	<antcall target="emcb"/>
	</parallel>
</target>

It is best not to modify this task. It simply starts your application and begins the client optimization tasks.


Core client optimization tasks

Following are the core client optimization tasks such as the Extract, Merge, Configure, and Bind tasks. These tasks are placed within a loop structure defined by the ${extract.iterations}. The number of iterations is determined by the number specified in build.properties. You can change the length of the automated process by changing the value in the build.properties file.


Listing 5. Core tasks
         
<target name="emcb">
	<echo message="Extract,Merge,Configure,Bind Attempts" />
		<for list="${extract.iterations}" param="attempt">
			<sequential>
			<sleep minutes="${sleep.minutes}"/>
			<echo>Extract,Merge,Configure,Bind Attempt#
			 @{attempt}</echo>
			<antcall target="deactivate_runtimegroup"/>
			<antcall target="extract_runtimegroup"/>
			<copy todir="${repository.captureFolder}/A
			Attempt-@{attempt}-${TODAY}">
			<fileset dir="${repository.extractFolder}"/>
			</copy>
			<antcall target="merge_incremental"/>
			<antcall target="configure_incremental"/>
			<antcall target="update_runtimegroup"/>
			<antcall target="report_repository"/>
			<antcall target="report_diff"/>
			<antcall target="bind"/>
			<antcall target="delete_incremental"/>
			<antcall target="activate_runtimegroup"/>
		</sequential>
	</for>
</target>

Any of the above tasks can be configured. For example, if you want to change the pureQuery runtime property to switch from executing in dynamic mode with capture on to static mode, you would use the task copy todir in the previous Core Tasks example, and copy a pdq.properties file to the ${repository.upload} folder. Then you call <antcall target="update_runtimegroup"/> to update the runtime group with the new property. You should familiarize yourself with the client optimization tasks as well as Apache Ant before trying to customize the tasks. Changes to the Ant script require familiarity with the client optimization process. For example, the configure_incremental task usually goes after merge_incremental task. Also, you always need to run the deactivate_runtimegroup task before running the extract_runtimegroup task. These are just some of the conventions that must be followed. If you are still learning about client optimization, you should try simple changes before making complex changes.

4 of 8 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, WebSphere, Open source
ArticleID=658993
TutorialTitle=Managing pureQuery-enabled applications efficiently, Part 3: Automate client optimization with WebSphere applications
publish-date=05192011
author1-email=tonysun@us.ibm.com
author1-email-cc=