timeout for hibernate database connection changed to value 5 seconds.(corrections in ConnectionManager class and printfs added and commented in DatabaseFactory and DatabaseManagement classes)

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-access/DatabasesResourcesManager@99376 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Loredana Liccardo 2014-09-01 14:45:00 +00:00
parent 10488ac084
commit ecee3f5fdf
4 changed files with 10 additions and 7 deletions

View File

@ -1,11 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -211,7 +211,7 @@ public class ConnectionManager {
} catch (Exception e) {
// e.printStackTrace();
e.printStackTrace();
// System.out.println(String.format("Error while executing query: %1$s %2$s",
// query, e.getMessage()));

View File

@ -40,7 +40,7 @@ public class DatabaseFactory {
public static SessionFactory initDBConnection(String configurationFile,
LexicalEngineConfiguration config)
throws Exception {
// AnalysisLogger.getLogger().debug("DatabaseFactory-> start init");
if (config == null)
return initDBConnection(configurationFile);
@ -137,7 +137,8 @@ public class DatabaseFactory {
*/
if (element.equals("c3p0.checkoutTimeout")) {
currentnode.setText("" + (20000)); //added a timeout about 30 seconds
// currentnode.setText("" + (20000)); //added a timeout about 30 seconds
currentnode.setText("" + (1000)); //added a timeout about 5 seconds
}
// if (element.equals("c3p0.acquireRetryAttempts")) {
@ -154,6 +155,7 @@ public class DatabaseFactory {
cfg.setProperty("hibernate.hbm2ddl.auto", "create");
SessionFactory DBSessionFactory = null;
// AnalysisLogger.getLogger().debug("DatabaseFactory-> buildSession");
DBSessionFactory = cfg.buildSessionFactory();
// close stream

View File

@ -469,7 +469,7 @@ public class DatabaseManagement {
List<String> list = new ArrayList<String>();
if (DBType.equals(POSTGRES)) {
// AnalysisLogger.getLogger().debug("DatabaseManagement-> execute query");
List<Object> resultSet = connection.executeQuery(
listSchemaNameQuery, sourceDBSession);