Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


DataBase Tracing Features
The latest enhancements

One of the "new" features in PowerBuilder 10.5 was actually initially introduced in the PowerBuilder 10.2 maintenance release. The folks at Sybase finally addressed a number of fundamental issues with database tracing for deployed applications.

Trace File Location
Users are often running under accounts that don't have Administrative or Power User privileges. As a result, they may not have sufficient rights to create a file in the WINDOWS directory, the very directory where a deployed application was hard coded to store the trace file. We've been able to specify an alternative location for applications run out of the IDE since PowerBuilder 6.0 by setting the DBTraceFile parameter in the database section of the PB.INI file. It wasn't until these new database tracing features were added that we gained this ability for deployed applications.

Database Trace Prompt
Until these new features were introduced, PowerBuilder would display a message box indicating the location of the database trace file (see Figure 1). With the new database tracing features, the message box has been replaced with a dialog that allows the end user to modify many characteristics of the database trace (see Figure 2). More important, the developer now has the option to suppress the dialog completely (see Controlling Tracing below). The dialog may have been, at worst, annoying for a deployed application that has a user operating it. However, the dialog actually prevented database trace capability for deployed components or applications that were installed as services. Worse, since there wasn't a user to respond to the database trace message box, the application would hang when a database trace was attempted.

Level of Trace Detail
The amount of information that PowerBuilder collects in a database trace is extensive and often overwhelming. For example, if we are simply trying to gather timing information in order to determine which statements are slowing down our application, we simply don't have a need to see each record as it's retrieved from the database. Until this new functionality was added, we got it whether we wanted it or not. Now we have much greater control over what is actually recorded to the database trace file, so we can focus on just the information we actually need to see.

Dynamic Tracing
Prior to the introduction of these enhancements, we needed to enable tracing before connecting to the database and then record every database interaction the application was involved with up through the area we were actually interested in, and then on further until the application disconnected from the database. Depending on how much we needed to do before we reached the area we were interested in, we might record a lot more tracing data than we actually needed. With these enhancements, we can turn on database tracing dynamically, so we can focus on just those interactions we are actually interested in. In addition, the enhancements include a separate ability to do a statement-level trace.

Controlling Tracing
Unlike the DBTraceLog setting for the IDE, the control over the new database tracing functions is handled through the registry under the "HKEY_CURRENT_USER\Software\Sybase\PowerBuilder\10.5\DBTrace" key (see Figure 3). The LogFileName registry entry takes a string value that points to the location of the trace file. The SQLTraceFile takes a string value that points to the location of a trace file for recording statement-level tracing. The remaining entries take string values of either "1" or "0" to indicate that the particular feature is enabled or disabled.

The ShowDialog option determines whether the application attempts to show the tracing dialog (see Figure 2) to the user. If it is shown to the user, the option values shown in the dialog will be based on the current values of the registry entries. If the user changes those options, the values he or she selected are recorded back out to the system registry.

To compare the functionality provided by these various options, consider, first, a somewhat typical trace file from PowerBuilder prior to these modifications (see Listing 1). You see the statement being prepared, the binding performed, the statement executed, and then the fetching of every record along with the data from every record. Finally, the previous version gives you the execution time for each individual action.

Compare that with the trace output when only DBI Names is selected (see Listing 2). Now you see the type of function being performed (PREPARE, BIND, EXECUTE, FETCH) and the SQL statement. In addition, the only other thing you see is the database interface functions being called. This is actually a new piece of information that was unavailable with the older tracing capability. What you don't see, however, is all of the binding information, the data being returned, or timing information.

The results from selecting just the Timing option (see Listing 3) or the Summary Timing option (see Listing 4) are not significantly different. Instead of the database interface functions, you see the timing for each operation or (another new capability) the total time since tracing was enabled. Once again, you've significantly reduced a great deal of information that you may not be interested in.

If you are only interested in seeing how PowerBuilder is binding to the dataset being returned (see Listing 5), you can turn on just the Bindings option. Alternatively, if you want to see the data as it's being returned (see Listing 6), you can enable the Data Buffers option.

Of course, these detail level options are not mutually exclusive; they can be used in combination to record just the specific information you need to see. If you enable them all, you essentially get the same effect as the previous database tracing functionality (with the addition of DBI Names and Summary Timing info). However, all of those options control only the level of detail for the standard tracing option. The statement-level tracing option records a fixed amount of information (see Listing 7) regardless of how those options are set.

Implementing Tracing
To do a standard trace, prefix the transaction object DBMS attribute with "TRA," just as we always have. However, there is a new PBTrace DBParm parameter that determines whether the tracing begins when the connection is made or if it's delayed until later. If the PBTrace parameter is set to 0 on the initial connection, tracing isn't performed until that parameter is changed to 1. It can then be set back to 0 to turn tracing off. What is a bit unusual, though, is that even if the parameter is set to 0 on the initial connection, if the ShowDialog option is set to 1, the database tracing dialog (see Figure 2) will be shown to the user when the initial connection is made. I would have expected the dialog to have been delayed until database tracing was actually initiated.

To do a statement trace, prefix the transaction object DBMS attribute with "TRS." The same PBTrace DBParm parameter can be used to dynamically determine when tracing begins and ends.

Conclusion
The latest enhancements to the database tracing functionality address some long-standing concerns. They allow us to control the detail and scope of the tracing, and finally make it possible for us to perform tracing on components or services that cannot interact with the user.

About Bruce Armstrong
Bruce Armstrong is a development lead with Integrated Data Services (www.get-integrated.com). A charter member of TeamSybase, he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and the editor of SAMs' PowerBuilder 9: Advanced Client/Server Development.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

One of the 'new' features in PowerBuilder 10.5 was actually initially introduced in the PowerBuilder 10.2 maintenance release. The folks at Sybase finally addressed a number of fundamental issues with database tracing for deployed applications


Your Feedback
Sys-Con Australia News Desk wrote: One of the 'new' features in PowerBuilder 10.5 was actually initially introduced in the PowerBuilder 10.2 maintenance release. The folks at Sybase finally addressed a number of fundamental issues with database tracing for deployed applications
Enterprise Open Source Magazine Latest Stories . . .
Apache Deltacloud, the Red Hat-contributed ReSTful API that abstracts differences between clouds so services on any cloud can be managed – provided of course there’s a driver – has graduated from the Apache Foundation’s incubator and is now a full-fledged Top-Level Project (TLP). The...
With Cloud Expo 2012 New York (10th Cloud Expo) just four months away, what better time to start introducing you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical and st...
AMD said late Tuesday that its chief sales officer Emilio Ghilardi had left the company and that CEO and president Rory Read is going to do his job while a replacement is sought. AMD didn’t say why Ghilardi left but it’s assumed Read wants his own people. Read is relatively new to th...
During the lifespan of M3 (Monitis Monitor Manager) there has always been something lacking – timers. M3 execution procedure was outlined in this previous article. The execution mentioned in the latter was a one-time-execution, whereas server monitoring requires periodic invocati...
Red Hat is putting its bought-in Gluster scale-out NAS storage technology, acquired in October, on the Amazon cloud. It’s styled Red Hat Virtual Storage Appliance for Amazon Web Services and other clouds are supposed to follow in short order.
A new episode of the screencast series is now available at the OpenNebula YouTube Channel. This screencast demonstrates the new easily-customizable self-service portal for cloud consumers. Its aim is to offer a simplified access to shared infrastructure for non-IT end users. The scree...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE