Issue
- Whenever a LAR is tried to be generated the following message shows on the portal:
Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
- Also on the console, the logs shows:
11:35:24,527 ERROR [liferay/background_task-1][JDBCExceptionReporter:82] Connection has already been closed.
11:35:24,540 ERROR [liferay/background_task-1][JDBCExceptionReporter:82] Connection has already been closed.
11:35:24,573 ERROR [liferay/background_task-1][JDBCTransaction:120] JDBC rollback failed
java.sql.SQLException: Connection has already been closed.
Environment
Resolution
- Specify a greater timeout on the Connection Pool. The parameter removeAbandonedTimeout is set to 300 by default.
- In the context add the removeAbandonedTimeout parameter with a greater value than the default one (The XYZ value) The value will depend on the environment.
<Context ...>
...
<Resource name="jdbc/EmployeeDB"
auth="Container"
type="javax.sql.DataSource"
username="dbusername"
password="dbpassword"
driverClassName="org.hsql.jdbcDriver"
url="jdbc:HypersonicSQL:database"
maxTotal="8"
maxIdle="4"
removeAbandonedTimeout = XYZ/>
...
</Context>
- If the export still fails, set the value to false so there is no time limit. Then, for security, configure it again after the export successfully happens with an appropriate time.