Deploying a component to EAServer
If you are developing a PowerBuilder custom class user object
containing business logic that will be deployed to a transaction
server, there are some database connectivity issues to keep in mind.
For detailed information about the files you need to deploy
with applications or components you build in PowerBuilder, see the
chapter on deploying your application in Application Techniques
.
If you want the component you are developing to take advantage
of EAServer’s support
for connection pooling and transaction management, you must use
one of the database interfaces supported by the transaction coordinator
being used by EAServer. EAServer supports the Microsoft Distributed
Transaction Coordinator (DTC) and the Java Transaction Service (JTS)
for OTS/XA Transactions.
The default coordinator is the JTS coordinator.
Setting the transaction coordinator The transaction coordinator is set through EAServer Manager
using the Transaction tab of the Server Properties dialog box.
Supported database connections when using Shared
Connection
The pseudo-coordinator shared connection is built into EAServer. In this model, all
components participating in a transaction share a single connection. To
use this model, all of your application data must reside on one
data server, and all components that participate in a transaction
must use a connection with the same user name, password and server
name or the same EAServer connection
cache name as defined in the CacheName DBParm. It supports the following
database interfaces to connect to the database:
- ODBC
database interface, which provides connectivity to a variety of databases through
ODBC drivers. The same ODBC drivers shipped with PowerBuilder are
also supported on EAServer. - Sybase SYJ database interface, which provides connectivity
to Adaptive Server Enterprise 11.5 or later. (Some versions of Open
Client and Adaptive Server currently do not support OTS/XA
transactions on Windows NT.) - JDB database interface, which provides connectivity
through Sun’s Java Virtual Machine to a JDBC driver such
as Sybase jConnect. - Oracle O84, O90, and O10 database interfaces, which
provide connectivity to Oracle8i, Oracle9i,
and Oracle 10g databases.
Supported database connections when using Microsoft
DTC
Microsoft Distributed Transaction Coordinator (DTC) uses two-phase
commit to coordinate transactions among multiple databases. This
transaction coordinator supports the following database interfaces
to connect to the database:
- ODBC database interface.
Support is limited to the following ODBC drivers: Microsoft SQL Server 6.5 or later and Microsoft
ODBC driver for Oracle. - JDB database interface, which provides connectivity
through Sun’s Java Virtual Machine to a JDBC driver that
acts as a JDBC-ODBC bridge.
Supported database connections when using OTS/XA
This option uses the Transarc Encina transaction coordinator
that is built into EAServer.
The Encina transaction coordinator uses two-phase commit to coordinate
transactions among multiple databases. This transaction coordinator
supports the following database interfaces to connect to the database:
- The SYJ database interface, which provides connectivity
to Adaptive Server Enterprise 11.5 or later. (Some versions of Adaptive
Server do not support OTS/XA transactions on Windows NT.) - The JDB database interface, which provides connectivity
through Sun’s Java Virtual Machine (JRE 1.2 or later) to
a JDBC driver that supports the Java Transaction API (JTA) such
as Sybase jConnect 5.2. - Oracle O84, O90, and O10 database interfaces, which
provide connectivity to Oracle8i, Oracle9i,
and Oracle 10g databases.
Using the SYJ database interface
EAServer uses a slightly
different version of the Sybase Open Client CT-Library (CT-Lib)
software from PowerBuilder. Therefore, at runtime, you need to use
SYJ rather than SYC to connect to an Adaptive Server Enterprise database.
The SYJ Database Profile Setup dialog box provides a convenient way
to set the appropriate connection parameters and then copy the syntax from
the Preview tab into the script for your Transaction object.
You cannot use the SYJ interface, however, to connect to the
database in the PowerBuilder development environment. Therefore,
during the development phase (before the component has been deployed
to Jaguar), you must use SYC to connect to the database.
Note that the SYJ database interface supports only those DBParms
relevant at runtime. It does not support any DBParm parameters that
have to be set before PowerBuilder establishes a database connection.
The following DBParms, which are included on the SYJ Profile Setup
dialog box, are not supported by SYJ:
- All the
DBParms on the Regional Settings tab including CharSet, Language,
and Locale - All the Directory services DBParms on the Directory
Services tab - All the Security services DBParms on the Security
tab - All the DBParms on the Network tab including AppName,
Host, MaxConnect, PacketSize, and PWEncrypt - The Release DBParm on the Connection tab
- The TableCriteria DBParm on the System tab
- The Asynchronous Operations DBParms, Async and DBGetTime,
on the Transaction tab
Using the JDB database interface
When you deploy a component developed using the JDB interface
to EAServer, PowerBuilder
checks the version of the JVM EAServer is
using against the version PowerBuilder is using. If the versions
do not match, a warning is entered in the Jaguar log file. PowerBuilder
uses the version loaded by EAServer.
The Jaguar log file records errors relating to component execution.
You can view its contents using the EAServer Manager File Viewer.
Specifying AutoCommit mode
For those DBMSs and database interfaces that support it (ODBC,
SYJ, and JDB), AutoCommit controls whether PowerBuilder issues SQL statements outside or inside
the scope of a transaction. When AutoCommit is set to False (the
default), PowerBuilder issues SQL statements inside the
scope of a transaction. When AutoCommit is set to True, PowerBuilder
issues SQL statements outside the
scope of a transaction. AutoCommit is set using the AutoCommit Mode check
box on the Connection tab in the Database Profile Setup dialog box
or by giving it a value in a PowerBuilder application script.
However, if the component you are developing participates
in an EAServer transaction,
the AutoCommit setting is ignored. Instead, EAServer determines how the component’s
database operations execute as part of the transaction.