Legacy Knowledge Base
Published Sep. 10, 2025

Preparing a Sybase Database for Liferay

Written By

Isaac Wilson

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Are there any specific configurations needed when setting up a Sybase database to connect to a Liferay bundle?

Environment

  • Sybase 15.7, 16
  • Liferay Portal 6.1, 6.2
  • DXP 7.0, 7.1

Resolution

  • Unlike other database vendors, there are a couple of commands that must be executed on Sybase prior to connecting to Liferay to change some of the database's configuration defaults.
  • Once Sybase has been installed and after the database has been created (using a command like this example):
    create database lportal on default=1400 with override
    go

    it's recommended to then perform the following commands before connecting Liferay to the database:
    exec sp_dboption 'lportal', 'allow nulls by default', true
    go
    
    exec sp_dboption 'lportal', 'select into/bulkcopy/pllsort', true
    go
  • The first command will change the "NOT NULL" default on some tables that Liferay expects to allow nulls; while the second "select into/bulkcopy/pllsort" command allows operations to be performed that do not keep a complete record of the transaction in the log.

Additional Information

  • These configurations are noted in the environment setups found in LPS-41778 and LPS-52571
  • Many database vendors allow NULL values by default when not explicitly defined for a column. For example, a MySQL database connected to Liferay will, by default, allow NULL values in the ownerId column of the ResourcePermission table (see this MySQL documentation). However, if not explicitly defined in a Sybase database, the default is NOT NULL (see this Sybase documentation)
  • Further documentation and portal-ext.properties suggestions for Sybase and other common databases can be found in this Help Center document

 

Example portal-ext.properties for connecting Sybase 16 to Liferay 7.1:

jdbc.default.driverClassName=com.sybase.jdbc4.jdbc.SybDriver
jdbc.default.url=jdbc:sybase:Tds:localhost:5000/lportal
jdbc.default.username=sa
jdbc.default.password=myPassword

hibernate.dialect=com.liferay.portal.dao.orm.hibernate.SybaseASE157Dialect

custom.sql.function.isnull=CONVERT(VARCHAR,?) IS NULL
custom.sql.function.isnotnull=CONVERT(VARCHAR,?) IS NOT NULL
Did this article resolve your issue ?

Legacy Knowledge Base