Portlet Factory, Version 6.1.2


 

Modifying IBM WebSphere Portlet Factory properties for database operation

You need to modify several properties in WebSphere Portlet Factory cluster.properties file. The cluster.properties file tells WebSphere Portlet Factory where to store the Profile data.

  1. Open the cluster.properties file in a text editor, such as Notepad (Windows NT/Windows 2000). The cluster.properties file can be found in the nonservable_content_root\config directory.

  2. Disable the file-handler by putting a hash symbol before them, as shown here:
    #bowstreet.profiles.storage.handler=com.bowstreet.profiles.FileStorageHandler
    #bowstreet.profiles.storage.file.dir=${bowstreet.rootDirectory}/profiles
    #bowstreet.profiles.storage.file.enableLocking=true
    #bowstreet.profiles.storage.file.maxLockTries=5

  3. Enable the database handler property below by removing the hash symbol in front of it. This is the handler configuration for storing and retrieving profile set data:
    bowstreet.profiles.storage.handler=com.bowstreet.profiles.storagehandler.DbStorageHandlerImpl

  4. Optional: Uncomment the properties below to configure the storage handler to use database locking to ensure safe concurrent access to profile set records.

    Note: If these two properties are not enabled, a default of 15 seconds is used.

    bowstreet.profiles.storage.db.lockTimeout=5 bowstreet.profiles.storage.db.unlockTimeout=5

    Note: On IBM® WebSphere Application Server, the property "bowstreet.profiles.storage.db.unlockTimeout=" must be set to a value of "-1". This setting disables the property. If the property is not set to -1 an exception will result.

  5. Optional: Enable audit logging by uncommenting the one of the properties below. Enabling the first property will record profile set changes to the WebSphere Portlet Factory event log. Enabling the second property will turn off audit logging.
    bowstreet.profiles.storage.auditHandler=com.bowstreet.profiles.storagehandler.LoggingAuditHandlerImpl bowstreet.profiles.storage.auditHandler=com.bowstreet.profiles.storagehandler.NullAuditHandlerImpl

  6. Optional: Enable and configure the following properties if WebSphere Portlet Factory is running on a server that provides JDBC DataSource objects backed up by a pool. This is the connection Factory configuration that defines how the storage handler obtains database connections. Use the DataSource Factory when running on a server that provides JDBC DataSource objects backed up by a pool.

    Note: Each example value begins with the string, "{shared}". This tells the storage handler to share a single instance of a database connection factory across all instances of the handler. You should always use a shared connection factory.

    Note: The following properties and their values would normally appear on one line.

    For an application server managed data source:

    bowstreet.profiles.storage.db.connectionFactory={shared}com.bowstreet.profiles.storagehandler.J2eeDataSourceConnectionFactoryImpl

    For a WebSphere Portlet Factory-managed connection:

    bowstreet.profiles.storage.db.connectionFactory={shared}com.bowstreet.profiles.storagehandler.JdbcPooledConnectionFactoryImpl

  7. Optional: Set up a DataSource that is backed by a pool. The following property is the configuration data for the JDBC DataSource connection Factory. It specifies the JNDI name assigned to the DataSource object that the connection Factory should use when attempting to grab a DataSource and obtain connections from it. Refer to your application server's documentation on how to setup a DataSource that is backed by a pool.
    bowstreet.profiles.storage.connectionFactory.j2eeDataSource=jdbc/profdb

  8. If you are using a WebSphere Portlet Factory-managed JDBC connection, enter the configuration for WebSphere Portlet Factory's JDBC pooled connection factory as follows:

    Oracle

    For an Oracle database using Oracle's thin JDBC driver. The verification SQL, if defined, tells the connection factory to validate connections before they are given to the storage handler. The following example is for a Oracle (thin driver) configuration data for the JDBC pooled connection factory.
    bowstreet.profiles.storage.connectionFactory.jdbcUrl=jdbc:oracle:thin:@dbserver:port:db_name bowstreet.profiles.storage.connectionFactory.jdbcUserName=user_name bowstreet.profiles.storage.connectionFactory.jdbcPassword=password bowstreet.profiles.storage.connectionFactory.jdbcVerificationSql=select sysdate from dual

    SQL Server

    The following is an example of the configuration data for WebSphere Portlet Factory's JDBC pooled connection factory for a SqlServer database using the Microsoft JDBC driver.
    bowstreet.profiles.storage.connectionFactory.jdbcUrl=jdbc:microsoft:sqlserver://dbserver:port bowstreet.profiles.storage.connectionFactory.jdbcUserName=user_name bowstreet.profiles.storage.connectionFactory.jdbcPassword=password bowstreet.profiles.storage.connectionFactory.jdbcVerificationSql=select getdate()

    INET JDBC Driver

    This driver is not supported by WebSphere Portlet Factory. Use of the Microsoft equivalent driver is recommended.

    DB2

    The following is the configuration data for WebSphere Portlet Factory's JDBC pooled connection factory for a DB2 database using the IBM JDBC driver.
    bowstreet.profiles.storage.connectionFactory.jdbcUrl=jdbc:db2://server:port/instance bowstreet.profiles.storage.connectionFactory.jdbcUserName=user_name bowstreet.profiles.storage.connectionFactory.jdbcPassword=userpassword bowstreet.profiles.storage.connectionFactory.jdbcVerificationSql=select current timestamp

  9. Enable the "jdbcAcquireTimeout" property, which defines the amount of time, in milliseconds, WebSphere Portlet Factory is willing to wait for an existing connection to be returned to the pool before it creates a connection for the storage handler.
    bowstreet.profiles.storage.connectionFactory.jdbcAcquireTimeout=5000

  10. Enable the jdbcPoolSweepPeriod property, which controls the amount of time in seconds WebSphere Portlet Factory waits before sweeping the pool of inactive connections
    bowstreet.profiles.storage.connectionFactory.jdbcPoolSweepPeriod=30

  11. Enable the jdbcInactiveConnectionTimeout property, which defines the amount of time in seconds a connection is allowed to sit in the pool unused before it is considered to be inactive.
    bowstreet.profiles.storage.connectionFactory.jdbcInactiveConnectionTimeout=30

Parent topic: Setting up database storage


Library | Support |