liferayhsqldbsql-workbench-j

java.sql.SQLException: Connections could not be acquired from the underlying database! — HSQLDB


I have installed SQL Workbench/J Build 118 and I logged into the HSQL database of Liferay Portal.

Then I closed the SQL Workbench without making any changes to the database. I restarted Liferay tomcat server and then I get the following errors:

ERROR [localhost-startStop-1][DialectDetector:124] java.sql.SQLException:
Connections could not be acquired from the underlying database!

and this warnings:

WARN  [C3P0PooledConnectionPoolManager[identityToken->3c8jofUN]-HelperThread-#4][BasicResourcePool:1851]
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3249a129 --
Acquisition Attempt Failed!!! Clearing pending acquires.
While trying to acquire a needed new resource, we failed to succeed more than
the maximum number of allowed acquisition attempts (3).
Last acquisition attempt exception:
java.sql.SQLException: error in script file line: 
7 unexpected token: CONFLICT required: DEADLOCK

ps. I am using the latest version of HSQL JDBC Driver (v.2.3.3)


Solution

  • I resolved the issue by changing this line in the %LIFERAY_DIR%/data/hsql/lportal.script file :

    SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE
    

    to

    SET DATABASE TRANSACTION ROLLBACK ON DEADLOCK TRUE
    

    then I deleted this line:

    SET DATABASE SQL AVG SCALE 0
    

    And I started the server successfully.