Escolar Documentos
Profissional Documentos
Cultura Documentos
pg. 4
www.sys-con.com/pbdj
From the Editor
Eating Your Own
Dog Food
The res u l ts o f t h e la t es t p o ll b y
N o v a l y s o n P o w e r B u i l d e r u s e a re in.
The res ults are g o o d .
Industry Announcements
by Bruce Armstrong pg. 34
D a t a Wi n d o w.NET is a nom ine e in
pg.22
t h e 2 0 0 5 . N E T D e v e l o p e r s J o u r n a l
R e a d e r s C h o i c e Aw a r d s i n t h e
l i b r a r i e s a n d c o n t r o l s c a t e g o r y.
pg.14
Berndt Hamboeck
S yb a s e re p o r t e d t o t a l l i c en s e
revenues i ncre a s e d 7 % f o r
the four th quar te r e nd e d
December 31, 2004.
Mike Nicewarner
10
of its re l a t i o n a l d a t a b a s e
management system, Sybase
Adaptive Ser ver Enterprise for
L i n u x o n I B M s e S e r v e r
OpenPower systems.
09281 01314
Arthur Hefti
14
Jim ONeil
18
Rahul Jain
28
BRUCE ARMSTRONG
NANCY VALENTINE
SETA PAPAZIAN
MARTIN WEZDECKI
JOHN OLSON
BRUCE ARMSTRONG
RICHARD BROOKS
BAHADIR KARUV, PhD
SUBSCRIPTIONS
FOR SUBSCRIPTIONS AND REQUESTS FOR BULK ORDERS,
PLEASE SEND YOUR LETTERS TO SUBSCRIPTION DEPARTMENT
EDITORIAL OFFICES
SYS-CON MEDIA
135 CHESTNUT RIDGE ROAD, MONTVALE, NJ 07645
FAX: 201 782-9600
TELEPHONE: 201 802-3000
SUBSCRIBE@SYS-CON.COM
POWERBUILDER DEVELOPERS JOURNAL (ISSN#1078-1889)
is published monthly (12 times a year) for $149 by
SYS-CON Publications, Inc.,135 Chestnut Ridge Rd., Montvale, NJ 07645
Periodicals Postage rates are paid at
Montvale, NJ 07645 and additional mailing offices.
POSTMASTER: Send address changes to:
POWERBUILDER DEVELOPERS JOURNAL, SYS-CON Publications, Inc.,
135 Chestnut Ridge Rd., Montvale, NJ 07645
COPYRIGHT
Copyright 2005 by SYS-CON Publications, Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopy or any information storage and
retrieval system, without written permission. For promotional reprints, contact reprint
coordinator Kristin Kuhnle. SYS-CON Publications, Inc., reserves the right to revise,
republish and authorize its readers to use the articles submitted for publication.
WORLDWIDE NEWSSTAND DISTRIBUTION
Curtis Circulation Company. New Milford, NJ
NEWSSTAND DISTRIBUTION CONSULTANT
Gregory Associates/W.R.D.S. 732-607-9941 BJGAssociates@cs.com
FOR LIST RENTAL INFORMATION:
Kevin Collopy: 845 731-2684, kevin.collopy@edithroman.com
Frank Cipolla: 845 731-3832, frank.cipolla@epostdirect.com
All brand and product names used on these pages are trade names,
service marks or trademarks of their respective companies.
SYS-CON Publications, Inc., is not affiliated with the companies
or products covered in PowerBuilder Developers Journal.
BRUCE ARMSTRONG
ou might remember from my TechWave 2004 notes, eating your own
dog food is my favorite means of
describing a company using its own products in its public interface to their customers
(e.g., their Web site). If a company expects
their customers to put faith in the utility
and stability of the product, they should be
showing that same confidence in the product themselves.
I also mentioned in last months editorial that the Audiovox SMT5600 Im now
using and the Motorola MPX220 both use
the mini-SD card rather than a standardsized SD memory card. If youre as unfamiliar as I was with the mini-SD card at that
time, you may not realize that the mini-SD
card comes with an adapter that will allow
it to work in a standard SD slot. Pretty slick.
SmartPhone Review
The folks at eWeek just did a review of the
Motorola MPX220 that I was so hot for a while
back (they also reviewed one Palm and one
BlackBerry device). One interesting note from
their review was the following: Wed love to
see smartphone hardware and software vendors license SureType from RIM for inclusion
in their products the technology represents
one of the best new ideas in mobile device
input that weve seen in some time.
As I indicated in my last comments on
the smartphone platform, the key hurdle is
user input. It sounds like BlackBerry has
come up with an advance in that area. Most
phones use the same letter-to-number key
assignments as a house phone, which
requires anywhere from two to four key
presses to obtain a single correct letter. The
BlackBerry keyboard uses a standard
QWERTY typewriter layout, with only one
or two letters assigned to each key, making
it much easier for the predictive software to
guess which letter you are trying to type.
brucea@sys-con.com
AUTHOR BIO
Bruce Armstrong is a senior programmer with Integrated Data Services (www.get-integrated.com). A member of TeamSybase,
he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CONs PowerBuilder 4.0
Secrets of the Masters and the editor of SAMs PowerBuilder 9: Advanced Client/Server Development.
www.SYS-CON.COM/pbdj/
MOBILE APPS
Introduction
For those who missed the last issue, I
will recap what Sybase Unwired Accelerator is:
First off, its a rapid mobilization
solution. When Sybase says, What
used to take months, now takes
hours, it happens to be true.
Its got RAD tools to accelerate mobilizing Web applications, intranets,
portals, databases, XML and Web
services.
It supports connected access from
BlackBerrys,
PocketPCs,
WAPenabled phones, laptops and tablets.
It supports disconnected access
from BlackBerrys and when used
with M-Business Anywhere, another
Sybase product, disconnected access
from PocketPCs, Palm devices and
tablets.
Its a superset of Sybase Enterprise
Portal (and contains EP-Information
Edition and all the Mobile capabilities).
Youll get the big picture and whats
possible with Unwired Accelerator in
Figure 1.
FIGURE 1 | UA in action
www.SYS-CON.COM/pbdj/
2003 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
HE SAYS J2EE.
SHE SAYS .NET.
YOU SAY POWERBUILDER
PowerBuilder 9.0 gives you the power
and flexibility to create applications for
the platform of your choice in todays
heterogeneous environments. Youll find
new RAD JavaServer TM Pages, tools for
Web Services, third-party application
server support and more. Get the power
you need to develop and integrate
new Web, n-tier and rich-client apps.
Technical details are waiting for you
now at sybase.com/powerbuilder.
INFORMATION LIQUIDITY.
FIGURE 2 |
Mobile Web
Studio menu
Building an Application
Now its time to start to write a simple application that users can see from
a mobile device. Were going to build it
from an existing Web application (try
http://<your machineneame>:4040/
custview/Search.jsp and enter any
username and password combination
to log in to the sample app included in
Unwired Accelerator).
The steps for creating the mobile
application using Web Studio include:
Create the application with a Web element using the Application Builder
wizard, save it and give it a name,
access privileges and additional configuration details. We will also approve
it to make it available for the public.
Add the application to a page and
add this page to an existing page
group so our mobile users can call
the page using, say, Pocket Internet
Explorer.
Result
You see the New Web Element window including the search
result of the included Web application. When we move the
mouse over the table with the data it changes so that we
see that it is the right place to click it.
www.SYS-CON.COM/pbdj/
Source: 08830081A
GET MORE
OUT OF
POWERBUILDER
WITH
POWERDESIGNER 9.5.2!
1-877-230-6771 | www.sybase-iad-services.com/30081a
Result
Conclusion
Sybase Unwired Accelerator is an
interesting tool if you want to create
Web applications for mobile devices.
Most of the pages needed can be created by changing a few properties. In this
simple example we used only a few of
the available options. We didnt touch
Resource
My PBDJ blog: http://bruce.pbdjmagazine.com
www.SYS-CON.COM/pbdj/
TECHNIQUES
WRITTEN BY
MIKE
NICEWARNER
he purpose of this article is to discuss and describe the terms Surrogate Key and Natural Key, and
explain when they are appropriate to use
in a data model. Furthermore, the concepts of Intelligence and Generated
will be applied to both types of keys.
The goal is for the reader to understand the plusses and minuses of all
forms of identifying records uniquely
in a database system. The reader is also
challenged to think critically about the
business situation before adopting any
given identification methodology.
Terms Defined
AUTHOR BIO
Mike Nicewarner has
been doing data
modeling since the
early 1990s for a
number of insurance,
manufacturing and
finance companies. He
has taught and written
papers about data
modeling tools and
techniques. When it
comes to modeling
tools, he strives to
improve the state-ofthe-art for everyone
involved.
10
SURROGATE KEY
A surrogate key is a column or
columns that are not defined by business requirements, but are added to a
table simply to identify records
uniquely. For example, a business
might define a set of related attributes
that it wants to keep track of. In that list
there may be a number of items that
could be considered unique (candidate
keys), but none appear to be stable
enough to be the primary identifier for
the set of attributes. The data analyst
might suggest an additional attribute
in the form of an Entity Name plus the
text Identifier. For instance, for an
entity called Survey, this would be
Survey Identifier. There is no business purpose or meaning for this new
attribute, and therefore the resulting
table column would be more resistant
to business changes.
NATURAL KEY
A natural key is a column or
columns that a business chooses to
uniquely identify records. The data
analyst allows them because they are
considered stable enough to be the
primary identifier. For instance, an
existing business process might define
a Product Code that uniquely identi-
www.SYS-CON.COM/pbdj/
BE YOUR OWN
POCKET POWERBUILDER
2003 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
12
My sympathy to
anyone who has
had to make
massive changes
throughout a DB2
subsystem because
of an intelligent
key that was
anything but
Best Practices
So, whats the best thing to do? Well,
that depends, of course. There is no
absolute mandate that says theres only
one way to manage keys. However, to
minimize the impact of future business
changes, there are a few rules of thumb
with a good track record.
Make every attempt in the initial
design to find an absolutely stable
primary identifier. Press the business
to be honest and say upfront whether
theres any possibility that the natural
key they recognize will ever change in
mike@datamodel.org
www.SYS-CON.COM/pbdj/
T H E S T R A I G H T G O O D S O N E A S e r v e r.
WITHOUT LEAVING
YOUR POWERBUILDER
INVESTMENT
BEHIND.
Its easy. Its proven. Sybase EAServer is the
Web. But dont just take our word for it. Sierra
www.sybase.com/pbextension. I n f o r m a t i o n A n y w h e r e
S Y B A S E e - B U S I N E S S S O F T W A R E.
TM
E V E R Y T H I N G W O R K S B E T T E R W H E N E V E R Y T H I N G W O R K S T O G E T H E R.
2002 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
PDOM Use
PBDOM stands for PowerBuilder Document Object Model. Its similar to the World Wide Web Consortiums DOM API and the Java-based
document object model for XML files JDOM. You can find a comparison of these three models in the PowerBuilder Help (PowerBuilder
Extension Reference/PowerBuilder Document Object Model/PBDOM
objects). Technically, PBDOM is implemented as a PBNI (PowerBuilder Native Interface) extension that makes use of the
Apache/Xerces DLL.
14
PBDOM Classes
All PBDOM classes (except PBDOM_Builder and PBDOM_Exception) are inherited from PBDOM_Object.
PBDOM_Builder is used to create a PBDOM_Document from data
sources like files, strings or DataStores.
PBDOM_Exception extends the PowerBuilder exception class and
is used for exception handling.
PBDOM_Object represents any node in an XML node tree and
serves as a base class for the different node types.
PBDOM_Document is the representation of the XML DOM document. It accesses document-level elements.
PBDOM_Element represents an XML element and accesses its
attributes, children and text.
PBDOM_Attribute is the representation of an XML attribute and
accesses its values and namespace information.
PBDOM_Text represents a DOM text node in a XML document.
PBDOM_Processinginstruction are the XML documents processing instructions.
When looking at Listing 1, the saved XML data from the DataWindow, you can see some of the described types. The class
PBDOM_Document references all the data including the XML header.
The PBDOM_Processinginstruction object references the data in the
XML header (e.g., version).
[Processing instructions are used to send instructions to the application that is reading the XML. They begin with "<?" and contain a
target (e.g., "xml-stylesheet") that indicates which application should
be reading the instruction, followed by data for that application and
finally a closing "?>". Technically, the XML Declaration is not a Processing Instruction, although it is often referred to as such and does
has a similar format. Editor.]
The items CUSTOMERS, CUSTOMER, FIRSTNAME etc. are
PBDOM_Elements. The ID in the CUSTOMER tag is a
www.SYS-CON.COM/pbdj/
You will find more details about namespaces on the W3C web site
and many examples and answers on the XML Namespace FAQ at
http://www.rpbourret.com/xml/NamespacesFAQ.htm.
Before you can start working with PBDOM, you have to add
PBDOM100.PBD to the library list. In PowerBuilders application
search path the following files should be accessible: PBDOM100.DLL,
PBXerces100.DLL and xerces-c_2_1_0.dll. You have to deploy these
four files with your application. For PowerBuilder 9 choose the
appropriate PBD and DLLs, whereas the Xerces DLL is the same as for
PowerBuilder 10.
array. The function then loops over the attributes and as soon as the
attribute with the name to search for is found the value is checked.
When the value matches, the element is returned. If there is no match
and the element has children, the method calls itself passing that element.
[There are W3C standard methods for searching XML documents
known as XPath and XQuery. However, at least when this article was
written, PBDOM does not support XPath or XQuery type operations.
Editor]
After the appropriate element is found, I add a sales order header
(see Listing 5). At first I create a sales order with CREATE
PBDOM_Element. Then I set the name of this instance to SALESORDER with the method SetName. The SetName method validates the
name (e.g., for spaces in the element name). I then add an attribute
with the name ID and the value 111. For the sales order, I need an
order date and region. I create them, set their name and put the value
into it with SetText. After all these elements are prepared, I put them
together with the method AddContent, which checks the data for
structure (e.g., no loops in a tree) and consistency of namespace to
ensure there is only one root element. To catch the run-time errors, I
put a TRYCATCH statement around the call.
To demonstrate some additional data manipulation, I also remove
the customer with ID equals 104. The search for that customer is
done using the same method shown in Listing 4. To remove that element the method Detach is used:
lpbdom_Found.Detach()
Conclusion
The PDBOM interface is a powerful way to manipulate complex
www.SYS-CON.COM/pbdj/
15
16
AUTHOR BIO
Arthur Hefti is CEO of CATsoft Development GmbH in Zurich. He has been a PowerBuilder developer for
10 years and has taught dozens of PowerBuilder training classes. He and his team create custom-made
client/server and web software with PowerBuilder and JBoss using XML, Web Services and encryption
quite frequently.
arthur@catsoft.ch
lpbdom_Ele = lpbdom_Obj[ll_Counter]
IF lpbdom_Ele.GetName()=as_Element
THEN
// Get Attributes
lpbdom_Ele.GetAttributes(lpbdom_Attrib)
li_Max = UpperBound(lpbdom_Attrib)
// Loop over all Attributes
FOR li_Counter = 1 TO li_Max
ls_Attribute = &
lpbdom_Attrib[li_Counter].
GetName()
IF ls_Attribute = as_Attribute
THEN
IF lpbdom_Ele.GetAttributeValue
(ls_Attribute)&
= as_Value THEN
apbdom_Found = lpbdom_Obj
[ll_Counter]
lb_Found = TRUE
EXIT
END IF
END IF
NEXT
END IF
IF NOT lb_Found AND &
lpbdom_Ele.HasChildren() THEN
lb_Found = &
This.of_FindElementWithAttribute
Value( &
apbdom_Found,as_Element,as
_Attribute,&
as_Value,lpbdom_Ele)
END IF
END IF
IF lb_Found THEN
EXIT
END IF
NEXT
RETURN lb_Found
www.SYS-CON.COM/pbdj/
2003 Sybase, Inc. All rights reserved. All trademarks are the property of their respective owners.
POWERBUILDER
THE CLASSIC,
TRIED-AND-PROVEN
CLIENT/SERVER
DEVELOPMENT TOOL.
POWERBUILDER
THE HANG-ONTOYOUR-SEAT
CLIENT/SERVER
DEVELOPMENT TOOL.
at sybase.com/powerbuilder.
at sybase.com/powerbuilder.
INFORMATION LIQUIDITY.
SYBASE INTEGRATION TECHNOLOGIES.
E V E R Y T H I N G W O R K S B E T T E R W H E N E V E R Y T H I N G W O R K S T O PBDJ
GPBDJ
ETH
E R TM
.
volume11
volume12
issue
issue10
2
BOOK EXCERPT
Client Requirements
Client requirements for PowerBuilder applications that access
EAServer are no different than those for client/server applications.
Specific requirements are detailed in the Application Techniques
18
ONEIL
Server Requirements
All versions of EAServer have a serverstart.bat file (or serverstart.sh file on Unix platforms) that contains the core of the environment setup and the actual command to launch the server executable image (jagsrv). In EAServer 4.0 and later, a setenv and
optional user_setenv command file accompany the serverstart
script. When the serverstart script is invoked, it invokes the other
www.SYS-CON.COM/pbdj/
two scripts to set site-specific environment requirements complementing those required by the core EAServer product. The primary
environment variables used by EAServer 4.0 and later are shown in
Table 1.
For most installations, neither the serverstart nor the setenv script
requires modification. A user_setenv script may be required, though,
to supply additional libraries or classes. For example, Informix JDBC
connection caches require that the IBM Informix JDBC driver classes
be located on the CLASSPATH, and Oracle OCI caches on a Windows
2000 server require that the Oracle client software be accessible via
the PATH variable.
CLASSPATH
The CLASSPATH that is established for EAServer can be viewed
directly from the server properties of Jaguar Manager. Keep in mind,
however, that EAServer also uses custom class loaders during its execution, so the absence of a required class on the system CLASSPATH
doesnt necessarily mean that failure is imminent. However, the presence of a class on the system CLASSPATH can interfere with an identical class loaded by a custom class loader resulting in a Java ClassCastException or ClassNotFoundException. The remedy is to ensure
that all classes required by a component are loaded via custom class
loaders. You do this by including such classes in the java.classes
property of the associated application, web application, servlet,
package, component or even the server itself.
EAServer offers two tracing options to help diagnose class loader
errors.
Setting the com.sybase.jaguar.server.jvm.verbose property to true
causes the location from which each class is loaded to be recorded in the EAServer log file.
Setting com.sybase.jaguar.server.classloader.debug to true also
records the class loader used for each class.
Listing 1 is an excerpt from the EAServer log where both these
properties have been set. The trace lines prefaced with JCL: result
from the classloader.debug option, while the others originate with
the jvm.verbose setting. This particular example shows the sequence
used to instantiate the Java Connection Manager ( JCM) service upon
server startup.
BOOTCLASSPATH
Where Set
setenv
setenv
setenv
serverstart
BOOTCLASSPATH
PATH (Intel)
LD_LIBRARY_PATH
(Solaris) LIBPATH (AIX)
SHLIB_PATH (HP-UX)
BOOTLIBRARYPATH
HP-UX
AIX
Utility
Command
listdlls (from www. listdlls -r jagsrv.exe
sysinternals.com)
pldd
/usr/proc/bin/pldd pid, where pid is
the process ID of jagsrv determined
by running ps -ef | grep jagsrv
shl_get()
Requires implementing an EAServer
component that invokes shl_get()
genld
genld
The BOOTCLASSPATH is used with JDK 1.2 and later so the system
class loader can load classes before it loads the core Java classes provided in rt.jar. This is required whenever alternative implementations of classes located in rt.jar need to be used. For instance, in
EAServer 4, the EAServer ORB class is org.omg.CORBA.ORB and is
located in easclient.jar. Suns rt.jar distribution, however, also
includes this class. To ensure that EAServer uses the Sybase implementation, the serverstart script puts easclient.jar on the BOOTCLASSPATH ahead of rt.jar.
Other classes that need to access classes on the BOOTCLASSPATH
may also need to be added to the BOOTCLASSPATH. A common
example is third-party JDBC drivers used by EAServer connection
caches such as the Oracle Thin JDBC driver. If you include the driver
classes (such as %ORACLE_HOME%/jdbc/lib/classes12.zip) in the
CLASSPATH but not in the BOOTCLASSPATH, you will encounter a
ClassNotFoundException due to class loader conflicts.
PATH
www.SYS-CON.COM/pbdj/
JVMType Switch
When starting EAServer or installing it as a service on a Microsoft
Windows system, the -jvmtype switch can specify that the client,
server or classic Java VM be used (assuming that the JDK version and
operating system support is use). Historically, the Java server VM has
had a reputation for being less stable than the client VM, and
although its tuned for application server performance, you may
19
92
Potential Remedy
Set the driver property of the
Connection object to jaguar.
This error can have a number of
causes, as explained further in
this section.
Set the location or userid prop
erty of the Connection object.
Here, the protocol is either iiop or iiops. Next, match this value to
an entry at the beginning of the server log similar to this:
Dec 23 21:22:08 2002: Listener # 6: Jaguar_iiop: Active: yes
Protocol: IIOP: phoenix,9000 Security Profile: *NONE*
The most common causes for this behavior are that another server
instance is already running or that some other application has
already claimed use of that port. To verify, use the netstat command
to determine what ports are in use. Listing 3 shows some output of
the netstat command executed on a Solaris machine. Here the presence of ports 8080 and 9000 (both default EAServer ports) in a LISTEN state likely means that an EAServer instance is already running
on that machine.
In some cases, the EAServer log file alone might provide little
insight into why you failed to connect to the server. In these situations, you might have to resort to tracing the underlying network
protocol traffic. Using EAServer or Sybase and even third-party tools
there are ways to capture packets to and from EAServer in any of the
three supported communication protocols: IIOP, HTTP, and TDS.
IIOP Requests
20
ln_connect.options = ORBLogIIOP=true,ORBLogFile=c:\orb.log
www.SYS-CON.COM/pbdj/
You can also enable IIOP tracing on EAServer itself by setting the
com.sybase.jaguar.server.log.iiop server property to true. Many
internal workings of EAServer are handled via inter-component calls
using IIOP not to mention the fact that a server may be handling
many clients so IIOP logging causes the EAServer log to grow
quickly. You can reduce the size of the log somewhat by setting the
com.sybase.jaguar.server.log.iiop.ac property to true, which defers
the tracing until the server actually begins accepting requests from
clients.
HTTP Requests
When using PowerBuilder client applications, the primary mode of
communicating with EAServer is via IIOP. PowerBuilders GetURL
and PostURL functions, however, offer a mechanism to access
EAServer servlets and JSPs via the HTTP protocol (HTTPS is not supported here). In such a scenario, PowerBuilder accesses EAServer as
a web server, so you can diagnose connectivity issues as you would
when trying to access any web site from a browser client such as
Internet Explorer. The error and return codes are those defined by the
World Wide Web Consortium (W3C) in the HTTP specification available from www.w3c.org.
Three log files associated with EAServer running as a web server
can aid in diagnosing problems with HTTP client requests.
1. The HTTPRequest log provides a one-line summary of every URL
accessed, the IP address of the requesting client, the HTTP return
code and the number of bytes of data returned. This log also contains entries for failed requests such as the ubiquitous 404 Page
Not Found.
The default format for this file is the Common Log Format as
defined by the W3C. Extended log file format (as shown in Listing
6) can also be enabled by setting the
hostaddr
date
time
reqline
status
length
cookie
referer
user-agent
method
uri-stem
http_version
host
port
Instantiating Components
Most component instantiation failures happen because of coding
errors or problems in the server environment. PowerBuilder clients
(or other EAServer components making inter-component calls) usually initiate component instantiation via the Lookup or CreateInstance functions. Both methods are available on the Connection
object for client access and the TransactionServer object for intercomponent calls. The lower-level JaguarORB object can also be used
to access EAServer and instantiate components via the base CosNaming techniques.
TDS Requests
Tabular Data Stream (TDS) is Sybases proprietary protocol for
communicating between Open Client and Open Server applications,
such as Adaptive Server Enterprise. Although its rather restrictive in
22
Locating Components
Locating a component on EAServer before instantiating it involves
two distinct steps. First, verify that a component with the requested
name exists on one or more EAServers cataloged by the targeted
naming server. If the component is found, the second step is to confirm that the component instance found does indeed implement the
desired interface. The failure of either step results in EAServer reporting one of the following two exceptions:
omg.org/CosNaming/NamingContext/NotFound
omg.org/CORBA/OBJECT_NOT_EXIST
Now lets look a little closer at the processing involved here to get a
better understanding of common points of failure.
Lookup
The first step toward locating a component is verifying that the
named component is accessible to one of the naming server(s) specified in the Connection objects location property or in the ORBNameServiceURL property supplied when initializing the JaguarORB
object.
When using COSNaming via the JaguarORB object, the component
name is explicitly provided via the NameComponent structure. When
www.SYS-CON.COM/pbdj/
www.sys-con.com/pbdj/
Narrow
When using the CreateInstance method, the component is narrowed to a SessionManager::Factory interface only. It assumes that
the corresponding proxy used in the client application includes valid
interface methods implemented by the component. Any impending
failures in this regard are not made manifest until a method is
invoked on the component.
When using the Lookup method, the interface specified must be
the home interface of the requested EJB; otherwise, the actual lookup
will succeed, but the attempt to narrow the component to that interface will fail. The client will still show an error 57 code, which may be
puzzling because the component name itself could be correct.
When using the JaguarORB and the Narrow function of the PowerBuilder CORBAObj object, the interface must also be specified. A
failed Narrow method at runtime may produce no error; however, it
will result in aberrant application behavior. A good programming
practice is to always verify the implementation of an interface via the
is_a function on CORBAObj before attempting to narrow the object
reference to that interface.
24
Instantiating Components
A component isnt instantiated when the CreateInstance or
Lookup is issued. It happens when the first method call is requested
for that instance. The lookup step previously described results in a
list of EAServer profiles (a server and port combination) where the
requested component can be instantiated. In a clustered environment, this list likely includes multiple EAServers. The client ORB
always tries to instantiate a component on the first server in the profile list, assuming that the profile list is already in an order that
appropriately reflects the load-balancing technique selected for that
cluster. If the instantiation fails because of a communication error
(for example, the server has gone down), the request is retried transparently on the next server in the profile list returned by the naming
server.
Because the list of profiles is returned to the client from the naming server, theres a change in context in the interpretation of the
server locations included in those profiles. This change in context
can cause instantiation failures in two common scenarios:
When a standalone EAServer or a server in a cluster has an active
localhost listener (such as the loopback address of 127.0.0.1), that
listener is returned to the client application that requests a component along with the list of profiles. If the client ORB attempts to
use that localhost profile to instantiate the component, the
attempt will fail because localhost is now the client machine, not
the EAServer machine hosting the component. In a production
environment, theres no need for localhost listeners.
When accessing EAServer through a firewall, the server addresses
in the profile list returned to the client may be unreachable. In an
internal network, the private IP addresses (namely 10.x.x.x,
172.16.x.x and 192.180.x.x as designated by the Internet Assigned
Numbers Authority) are often used to identify machines running
on the corporate intranet. So the EAServer naming servers in that
environment use those internal addresses when creating the list
of profiles that indicate where a requested component can be
instantiated.
If that list of profiles is forwarded to service a request from an
EAServer client outside the firewall, the instantiation will fail because
these private Internet addresses arent reachable from the client.
When using firewalls that do network-address translation from publicly accessible IP addresses to private IP addresses, you must configure your clients host file to do reverse-address translation or use the
ORBProxyHost and ORBProxyPort parameters when initializing the
client ORB.
Assuming that the server on which the component is to be instantiated is indeed reachable, lets look at how EAServer loads the component implementation for a PowerBuilder component. Understanding the four main steps of this process, as outlined here, can help
identify the source of the errors if the instantiation fails:
1. EAServer determines the implementation model via the compo-
www.SYS-CON.COM/pbdj/
AUTHOR BIO
Jim ONeil is a principal technical support engineer at Sybase, Inc. He has been with Sybase for six years, concentrating on resolving customer issues with Sybase products such as PowerBuilder, EAServer and PowerJ. Prior to Sybase,
Jim spent about 10 years working as a software engineer for two defense contracting firms.
joneil@sybase.com
www.SYS-CON.COM/pbdj/
25
32768
8760 0
0
0
LISTEN
0
0
*.*
*.*
0
0
0
0
LISTEN
*.*
0
0
0
0
LISTEN
0 LISTEN
0
0
0
*.*
otter.44460 24820 0
8760 0
26
#Version: 1.0
#Date: 2002-12-21 18:50:40
#Fields: s-ip date time cs-request cs-status cs-bytes
cs(Cookie) cs(Referer)
199.95.51.242 2002-12-21 18:50:40 GET /ir/CtsServlet.html
HTTP/1.1 200 318 -
http://porkchop:8080/ir/index.html
199.95.51.242 2002-12-21 18:50:43 GET
/ir/CtsServlet__ServletService.html HTTP/
1.1 200 436 - http://porkchop:8080/ir/CtsServlet.html
199.95.51.242 2002-12-21 18:50:49 GET /ir/
CosTransactions.html HTTP/1.1 200 43
6 - http://porkchop:8080/ir/index.html
199.95.51.242 2002-12-21 18:52:14 GET /webapp/index.html
HTTP/1.1 404 369 - 199.95.51.242 2002-12-21 18:55:58 GET /customer/index.jsp
HTTP/1.1 404 361 -
www.SYS-CON.COM/pbdj/
DROPDOWN FILTERING
RAHUL JAIN
AUTHOR BIO
Rahul Jain is a
distributed systems
architect with Cynergy
Systems (www.cynergysystems.com). He has
more than eight years
of experience building
web, distributed
and client-server
applications using
PowerBuilder, EAServer
and EAF.
28
Here we will explore a more sophisticated approach that uses the XMLHttpRequest DOM object to retrieve
the data from the server using XML and
repopulate the dropdown without
refreshing the page. Our main purpose
is to show you how to use the XMLHttpRequest object. Its more useful
than just for dropdown filtering. It can,
for instance, be used to validate the
client-side data, get data dynamically
and call Web Services.
What is the XMLHttpRequest object?
The XMLHttpRequest document is a
client-side object that can process
HTTP calls with any valid URL.
Although its called the XMLHttpRequest object, its not limited to being
used with XML, it can request or send
any type of HTTP-compliant data using
standard HTTP calls.
What we basically do with this object
is send data to the server side and get
content back, all in the background.
The data returned could be a simple
string like true or a more complex
XML document. The return could also
be binary content, but that could be a
little difficult to handle in JavaScript.
Microsoft first implemented the
XMLHttpRequest object in Internet
Explorer 5 for Windows as an ActiveX
object. Firefox and Safari also come
with a native version of the object.
or
new ActiveXObject ("Microsoft.XML HTTP")
new XMLHttpRequest()
www.SYS-CON.COM/pbdj/
URL
PHONE
PAGE
www.active-endpoints.com
203-929-9400
Amyuni Technologies
www.amyuni.com
866-926-9864
33
Assande
www.assande.com
ClearNova
www.clearnova.com/thinkcap
770-442-8324
21
E.crane
www.ecrane.com
603-226-4041
36
iAnywhere
www.ianywhere.com
800-801-2069
35
IT Solutions Guide
www.sys-con.com/IT
201-802-3020
23
www.sys-con.com/pbdj
201-802-3026
27
Sybase
http://eshop.sybase.com/eshop
877-230-6771
11
Sybase
www.sybase.com/pbextension
877-230-6771
13
Sybase
www.sybase.com/powerbuilder
877-230-6771
5, 17
Sybase
www.sybase-iad-services.com/30081a 877-230-6771
Advertiser is fully responsible for all financial liability and terms of the contract executed by their
agents or agencies who are acting on behalf of the advertiser. This index is provided as an additional service to our readers. The publisher does not assume any liability for errors or omissions.
www.SYS-CON.COM/pbdj/
29
Synchronous and
Asynchronous Calls
Method
Description
abort()
getAllResponseHeaders()
getResponseHeader("headerLabel")
send(content)
setRequestHeader("label", "value")
30
Description
onreadystatechange
readyState
responseText
responseXML
status
statusText
References
You might find following links useful
for further reading:
Using the XML HTTP Request object:
http://jibbering.com/2002/4/httpre-
quest.html
Dynamic HTML and XML: The XMLHttpRequest Object: http://developer.apple.com/internet/webcontent/x
mlhttpreq.html
How to Submit Form Data by Using
XMLHTTP or ServerXMLHTTP Object:
http://support.microsoft.com/default
.aspx?scid=KB;ENUS;Q290591&ID=KB;EN-US;Q290591
Get dynamic Web content with
HTTPRequest: A refreshing approach
to page refreshes: www106.ibm.com/developerworks/web/li
brary/wa-httpget/
You also might want to read about
how Google uses XMLHttpRequest
object in its Gmail and Google Suggest
applications. This link might help:
Chris Justus Server Side Guy: Google
Suggest Dissected...: http://serversideguy.blogspot.com/2004/12/googl
e-suggest-dissected.html
rahul.jain@cynergysystems.com
www.SYS-CON.COM/pbdj/
Power Puzzle
1
2
4
5
6
7
8
9
10
11
12
13
15
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Created with EclipseCrossword www.eclipsecrossword.com
32
www.SYS-CON.COM/pbdj/
PowerBuilder News
All things of interest to the PB community
BY BRUCE ARMSTRONG
bruce.armstrong@teamsybase.com
Third-Party Tools
PBmiqui announced the availability of several code samples, including a wrapper for
the FreeImage DLL using
PBNI, a multiselect DDLB, and
Pbintelli, an expanded IntelliSense add-in for the PowerBuilder IDE, currently in beta.
www.miqui.it/
DataWindow.Net
DataWindow.Net is a nominee
in the 2004 Best .NET Products
of 2005 awards in the libraries
and controls category.
www.sys-con.com/dotnet/readerschoice2004
iAnywhere
2/14 iAnywhere Solutions, a
subsidiary of Sybase,
announced that SQL Anywhere
Studio powers innovative
health care applications developed by MedicWare,
MediNotes Corporation,
Microlog, and Microsys Computing, Inc. SQL Anywhere
Studio from iAnywhere helps
vendors deliver cost-effective
and quality health care solutions that enable organizations of any size to deliver
timely access to critical
patient information, streamline business processes, and
reduce administrative costs.
01/25 iAnywhere Solutions, a
subsidiary of Sybase,
announced that Relavis Corporation, a world leader in
customer relationship management (CRM) solutions, has
selected the iAnywhere Pylon
34
Sybase Corporate
01/15 Sybase reported total
license revenues increased 7%
for the fourth quarter ended
December 31, 2004 compared
with the same quarter the previous year. Total revenues for
the quarter increased 4% to
$218.6 million from $210.7
million for the
Events
TechWave 2005
August 21-25
Caesars Palace
Las Vegas, Nevada
www.sybase.com/techwave
www.SYS-CON.COM/pbdj/
We know
the ropes.
Wondering how to get your Wi-Fi projects off the ground? We can show
you how. Were iAnywhere Solutions,
the leading provider of solutions for
the unwired enterprise.
Emerging wireless technologies such
as Wi-Fi now enable businesses to
deliver a desktop computing experience to mobile workers. We have
more than a decade of experience
delivering "always available" access to
corporate data and applications
keeping your mobile workers productive when they dont have a wireless
connection and providing information
security and synchronization services
when they enter a wireless LAN or hot
spot.
More than ten thousand companies
and one thousand partners worldwide
rely on mobile technology from
iAnywhere Solutions.
Let us show you the ropes to get your
Wi-Fi solutions off the ground quickly. Call 1-800-801-2069 or visit
www.ianywhere.com.
Copyright 2003. iAnywhere Solutions, Inc. All rights reserved. iAnywhere is a trademark of Sybase, Inc. or its subsidiaries.
All other trademarks are the property of their respective owners.
www.ianywhere.com