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:  

Automation execution

Executing the automation process requires configuring the Build.properties file and running the Apache Ant script.

Configuring Build.properties

In the previous tutorials of this series, you were introduced to the .properties file read by Ant scripts. This build.properties file is included in the downloadable ZIP source and is no different from the previous .properties files. However, this build.properties file has many properties because our automation process deals with almost all of the remaining pureQuery client optimization tasks. It contains the following properties:

  • jdk.home=C:/eclipse_cmvc/ibm_jdk15
    • This is your JDK home directory.
  • websphere.dir=C\:/Program Files/IBM/WebSphere
    • This is the WebSphere home directory (only if WebSphere is on client machine).
  • websphere.datasource.dir=C\:/DB2_JCC_DRIVER_FOR_WAS
    • This is where the pdq.jar and pdqmgmt.jar, db2jcc.jar files, and pdq.properties files will be placed so WebSphere can access the files with the classpath. These files are required for client optimization (only if WebSphere is on client machine).
  • websphere.webinf.dir=C\:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/IBM-L3D7044Node02Cell/Test_war.ear/Test.war/WEB-INF
    • This is the directory where the application (WAR file) is installed. If you want to modify your application, you can modify the application without reinstalling the application through the admin console. You can stop the web server, copy over the .jar files or .class files, and restart the server (only if WebSphere is on client machine).
  • websphere.hostport=localhost:9081
    • This is the WebSphere host URL and port.

The properties below are used by the ManageRepository utility to connect to the repository.

  • repository.url=jdbc:db2://localhost:50000/TONYDB
    • This URL points the client optimization external database repository.
  • repository.user=tonysun
    • This is the user name to connect to the repository.
  • repository.password=******
    • This is the password to connect to the repository.
  • repository.driverClass=com.ibm.db2.jcc.DB2Driver
    • This loads the IBM JCC driver to be used by the application.
  • repository.type=pureQueryOnly
    • This sets up the repository type for the application.
  • repository.uploadFolder=c:/repository/upload
  • repository.extractFolder=c:/repository/extract
  • repository.captureFolder=c:/repository/capture
  • repository.http.request=c:/repository/http
    • These folders specify the home directory and folders where the upload, extraction, captured, and HTTP files will reside.

The following properties specify the runtimeGroup variables

  • runtimegroup.id=TONY01
    • This variable specifies the runtime group created for the application that uses the repository.
  • runtimegroup.version=v1
  • runtimegroup.contact=tonysun@us.ibm.com
    • The above two variables specifies the version and contact for the repository.
  • incremental.name=IncrementalCapture
    • This property specifies the base name of capture files created by client optimization during incremental capture. Hence, capture files will be named as IncrementalCapture_XXX.
  • extract.iterations=1,2,3,4,5,6,7,8,9,10
    • The above list specifies the number of executions for the extract, merge, configure, bind, and update process. At this time, due to the limitations of Apache Ant, you need to specify a list and not a number, such as N.
  • extract.hour=0
  • extract.minutes=2
    • The above time specifies the intervals between each extraction process.
  • application.url=http://localhost:9081/Test/TestSPServlet
    • This URL will launch the application. It will be loaded by the build.xml to launch the application within our automated Ant process.

Running Ant

Once the build.properties file has been configured, all you have to do is launch the build.xml script. Setting up Apache Ant and running an Ant script was shown in Part 1. The downloadable archive includes the repository.xml and build.xml files. You will run the build.xml, which calls the repository.xml.

During execution, the web application will run while the extract, merge, configure, bind, and update client optimization tasks occur simultaneously at regular intervals. Details about this process will be discussed in the next section.

Launching the build.xml can be done from the command line or inside an Optim Development Studio- or Eclipse-based environment (this was also shown in previous sections).


Figure 22. Running Ant
Pop-up menu shows choosing Run as -- Ant Build

3 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=