Author: nfilotto
Date: 2011-05-26 12:49:50 -0400 (Thu, 26 May 2011)
New Revision: 4434
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
Log:
EXOJCR-1352: close the connection to prevent application deadlock
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
---
jcr/trunk/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)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-05-26
16:49:50 UTC (rev 4434)
@@ -904,11 +904,13 @@
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.");
+ LOG.warn("Wrong default isolation level, please set the default
isolation level to READ_COMMITTED or higher. Other default isolation levels are not
supported");
}
}
catch (SQLException e)
@@ -919,6 +921,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