[Policy-24] Updated the Database Configuration 69/5069/1
authorrb7147 <rb7147@att.com>
Fri, 16 Jun 2017 18:36:01 +0000 (14:36 -0400)
committerrb7147 <rb7147@att.com>
Fri, 16 Jun 2017 18:36:47 +0000 (14:36 -0400)
Change-Id: Ie358df4bfef5fb9cfe136f52a9d35f119c55bc97
Signed-off-by: rb7147 <rb7147@att.com>
ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/HibernateSession.java
LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java
packages/base/src/files/install/mysql/data/161000_upgrade_script.sql

index 2aca54c..e2fa702 100644 (file)
@@ -48,7 +48,7 @@ public class HibernateSession{
                        configuration.setProperty("hibernate.connection.autocommit", "true");
                        configuration.setProperty("hibernate.c3p0.min_size", "5");
                        configuration.setProperty("hibernate.c3p0.max_size", "200");
-                       configuration.setProperty("hibernate.c3p0.timeout", "3600");
+                       configuration.setProperty("hibernate.c3p0.timeout", "2147483");
                        configuration.setProperty("hibernate.c3p0.idle_test_period", "3600");
                        configuration.setProperty("hibernate.cache.use.query_cache", "false");
                        configuration.setProperty("hibernate.cache.use_second_level_cache", "false");
index 5ddb623..73ecf79 100644 (file)
@@ -141,15 +141,19 @@ public class ParseLog {
                                     
                                                if (debugfile.isFile()){
                                                        // log4jlogger must use .info
-                                                       try (Stream<String> lines = Files.lines(debugfilePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info("Last-"+dataFileName+"-line-Read:" + debuglastNumberRead)).skip(debuglastNumberRead)) {
-                                                               
+                                                       Stream<String> lines = null;
+                                                       try {
+                                                               lines = Files.lines(debugfilePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info("Last-"+dataFileName+"-line-Read:" + debuglastNumberRead)).skip(debuglastNumberRead);
                                                                lines.forEachOrdered(line -> process(line, type, LOGTYPE.DEBUG));
-                                                               lines.close();
                                                        } catch (IOException e) {
                                                                logger.error("Error processing line in " + dataFileName + ":" + e);
                                                                logger.error("break the loop.");
                                                                isStop = true;
-                                                       }       
+                                                       }finally{
+                                                               if(lines != null){
+                                                                       lines.close();
+                                                               }
+                                                       }
                                                }
                                                try {
                                                        Thread.sleep(sleepTimer);
@@ -207,15 +211,19 @@ public class ParseLog {
                                        while (!isStop){
                                                if (errorfile.isFile()){
                                                        // log4jlogger must use .info
-                                                       try (Stream<String> lines = Files.lines(errorfilePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info("Last-"+dataFileName+"-line-Read:" + errorlastNumberRead)).skip(errorlastNumberRead)) {
-                                                               
+                                                       Stream<String> lines = null;
+                                                       try{
+                                                               lines = Files.lines(errorfilePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info("Last-"+dataFileName+"-line-Read:" + errorlastNumberRead)).skip(errorlastNumberRead);
                                                                lines.forEachOrdered(line -> process(line, type, LOGTYPE.ERROR));
-                                                               lines.close();
                                                        } catch (IOException e) {
                                                                logger.error("Error processing line in " + dataFileName + ":" + e);
                                                                logger.error("break the loop.");
                                                                isStop = true;
-                                                       }       
+                                                       }finally{
+                                                               if(lines != null){
+                                                                       lines.close();
+                                                               }
+                                                       }
                                                }
                                                try {
                                                        Thread.sleep(sleepTimer);
@@ -271,14 +279,18 @@ public class ParseLog {
                                                
                                                if (file.isFile()){
                                                        // log4jlogger must use .info
-                                                       try (Stream<String> lines = Files.lines(filePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info("Last-"+dataFileName+"-line-Read:" + lastNumberRead)).skip(lastNumberRead)) {
-                                                               
+                                                       Stream<String> lines = null;;
+                                                       try {
+                                                               lines = Files.lines(filePath, Charset.defaultCharset()).onClose(() -> log4jlogger.info("Last-"+dataFileName+"-line-Read:" + lastNumberRead)).skip(lastNumberRead);
                                                                lines.forEachOrdered(line -> process(line, type, LOGTYPE.INFO));
-                                                               lines.close();
                                                        } catch (IOException e) {
                                                                logger.error("Error processing line in " + dataFileName + ":" + e);
                                                                logger.error("break the loop.");
                                                                isStop = true;
+                                                       }finally{
+                                                               if(lines != null){
+                                                                       lines.close();
+                                                               }
                                                        }       
                                                }
                                                try {
index d7892c1..02a8315 100755 (executable)
@@ -44,6 +44,16 @@ CREATE DATABASE IF NOT EXISTS `ecomp_sdk`;
 USE `ecomp_sdk`;
 set foreign_key_checks=0;
 
+--
+-- Increasing the Database variable timeouts
+--
+
+set global wait_timeout=2147483;   
+set global interactive_timeout=2147483;
+
+set wait_timeout=2147483;   
+set interactive_timeout=2147483;
+
 --
 -- Table structure for table `actionbodyentity`
 --