Author: nfilotto
Date: 2011-05-26 12:26:13 -0400 (Thu, 26 May 2011)
New Revision: 4433
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
Log:
JCR-1618: close the connection to prevent application deadlock
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-05-26
15:31:18 UTC (rev 4432)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-05-26
16:26:13 UTC (rev 4433)
@@ -837,9 +837,11 @@
public void start()
{
// if isolation level lesser then TRANSACTION_READ_COMMITTED, print a warning
+ Connection con = null;
try
{
- if (getConnectionFactory().getJdbcConnection().getTransactionIsolation() <
Connection.TRANSACTION_READ_COMMITTED)
+ con = getConnectionFactory().getJdbcConnection();
+ if (con.getTransactionIsolation() < Connection.TRANSACTION_READ_COMMITTED)
{
LOG.warn("Wrong default isolation level, please set the default
isolation level to READ_COMMITTED or higher. Other default isolation levels are not
supported");
}
@@ -852,6 +854,20 @@
{
LOG.error("Error checking isolation level configuration.", e);
}
+ finally
+ {
+ if (con != null)
+ {
+ try
+ {
+ con.close();
+ }
+ catch (SQLException e)
+ {
+ // ignore me
+ }
+ }
+ }
}
/**
Show replies by date