Troubleshooting Datasource Port Changes During Deployment

Problem: Modified datasource port information is not reflected during deployment of MBOs.

Subsequent deployments of MBOs that have had their datasource port number changed are not reflected during deployment. For example:
  1. Create a database datasource named DB1 with port 4100.
  2. Create an MBO that references this datasource.
  3. Deploy the MBO to Unwired Server.
  4. Change port information for the connection profile from Enterprise Explorer to 41007.
  5. Redeploy the MBO to Unwired Server.

During the second deployment, the endpoint port is the original value 4100, and not 41007.

Solution: Run Ant scripts to modify datasource settings: Create an XML configuration file, and run configure.bat located in %SUP_HOME%\UnwiredPlatform\Servers\UnwiredServer\bin:

  1. Create an XML configuration file that contains the information to be modified, as the chgEndpoint.xml file illustrates:
    <?xml version="1.0" ?> 
    <project name="DDSOPS1" default="configure">
    
    <import file="ant-config-tasks.xml" />
    <import file="default-properties.xml" />
    <target name="configure">
    <setProperties dataSource="DDSOPS1" merge="false">
    <property name="databaseType" value="Sybase_ASE" />
    <property name="user" value="sup_cv" />
    <property name="password" value="xyz" />
    <property name="portNumber" value="41007" />
    <property name="serverName" value="ddsops1" />
    <property name="databaseName" value="tsbde" />
    </setProperties>
    </target>
    </project>
  2. Save the XML file in the %SUP_HOME%\UnwiredPlatform\Servers\UnwiredServer\config directory.
  3. Run configure.bat using the XML file as an argument from the command line in %SUP_HOME%\UnwiredPlatform\Servers\UnwiredServer\bin. For example: Configure chgEndpoint.xml

The port information is updated and reflected during deployment.

Note: The basic XML Ant scripts are the same for all datasource types. The properties vary depending on endpoint types.

For each JDBC datasource, the database vendor's specific JDBC driver may expose its own connection properties. You can specify those properties in an XML configuration file by prefixing the property name with "jdbc:".

For example, the Sybase jConnect for JDBC driver for Sybase contains an IS_CLOSED_TEST connection property that you can set. This property can be a SQL query that jConnect sends to the database when the application calls Connection.isClosed(), or "select 1". If the query successfully executes, the connection remains open, and returns false. The jConnect driver also has an "INTERNAL" setting that enables jConnect to remember the state of the connection the last time it was used. Thus the database is not pinged with useless queries, especially in an appServer context where the isClosed() check is done each time a connection is checked into or out of a connection pool. To set the "INTERNAL" property from the Ant script, add:

<property name="jdbc:IS_CLOSED_TEST" value="INTERNAL"/>

See your JDBC driver documentation for information about driver specific connection properties.


Created September 17, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com