From 6d73554967f116d26874bf328d152f1fd1191e6e Mon Sep 17 00:00:00 2001 From: jendib Date: Wed, 2 Sep 2015 01:12:33 +0200 Subject: [PATCH] #24: High performance is not going to happen on HSQLDB --- .../docs/core/dao/jpa/DocumentDao.java | 2 +- .../sismics/docs/core/util/DirectoryUtil.java | 8 ++-- .../main/java/com/sismics/util/jpa/EMF.java | 2 +- docs-parent/pom.xml | 2 +- docs-web/pom.xml | 47 +++++++++++++++++++ .../src/stress/main/webapp/web-override.xml | 16 +++++++ .../src/stress/resources/config.properties | 3 ++ .../src/stress/resources/hibernate.properties | 1 + .../src/stress/resources/log4j.properties | 8 ++++ 9 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 docs-web/src/stress/main/webapp/web-override.xml create mode 100644 docs-web/src/stress/resources/config.properties create mode 100644 docs-web/src/stress/resources/hibernate.properties create mode 100644 docs-web/src/stress/resources/log4j.properties diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java index f6ae41f1..87aac3a7 100644 --- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java +++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java @@ -183,7 +183,7 @@ public class DocumentDao { Map parameterMap = new HashMap(); List criteriaList = new ArrayList(); - StringBuilder sb = new StringBuilder("select distinct d.DOC_ID_C c0, d.DOC_TITLE_C c1, d.DOC_DESCRIPTION_C c2, d.DOC_CREATEDATE_D c3, d.DOC_LANGUAGE_C c4, "); + StringBuilder sb = new StringBuilder("select d.DOC_ID_C c0, d.DOC_TITLE_C c1, d.DOC_DESCRIPTION_C c2, d.DOC_CREATEDATE_D c3, d.DOC_LANGUAGE_C c4, "); sb.append(" (select count(s.SHA_ID_C) from T_SHARE s, T_ACL ac where ac.ACL_SOURCEID_C = d.DOC_ID_C and ac.ACL_TARGETID_C = s.SHA_ID_C and ac.ACL_DELETEDATE_D is null and s.SHA_DELETEDATE_D is null) c5, "); sb.append(" (select count(f.FIL_ID_C) from T_FILE f where f.FIL_DELETEDATE_D is null and f.FIL_IDDOC_C = d.DOC_ID_C) c6 "); sb.append(" from T_DOCUMENT d "); diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java b/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java index a4aad893..38b410da 100644 --- a/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java +++ b/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java @@ -104,10 +104,10 @@ public class DirectoryUtil { */ private static File getDataSubDirectory(String subdirectory) { File baseDataDir = getBaseDataDirectory(); - File faviconDirectory = new File(baseDataDir.getPath() + File.separator + subdirectory); - if (!faviconDirectory.isDirectory()) { - faviconDirectory.mkdirs(); + File directory = new File(baseDataDir.getPath() + File.separator + subdirectory); + if (!directory.isDirectory()) { + directory.mkdirs(); } - return faviconDirectory; + return directory; } } diff --git a/docs-core/src/main/java/com/sismics/util/jpa/EMF.java b/docs-core/src/main/java/com/sismics/util/jpa/EMF.java index fee2bb55..8b02a508 100644 --- a/docs-core/src/main/java/com/sismics/util/jpa/EMF.java +++ b/docs-core/src/main/java/com/sismics/util/jpa/EMF.java @@ -71,7 +71,7 @@ public final class EMF { properties.load(is); return properties; } - } catch (IOException e) { + } catch (IOException | IllegalArgumentException e) { log.error("Error reading hibernate.properties", e); } diff --git a/docs-parent/pom.xml b/docs-parent/pom.xml index e5bf45f9..a21f7424 100644 --- a/docs-parent/pom.xml +++ b/docs-parent/pom.xml @@ -24,7 +24,7 @@ 1.6.4 1.6.6 4.7 - 2.3.0 + 2.3.3 1.17 0.3m 3.1.6 diff --git a/docs-web/pom.xml b/docs-web/pom.xml index 2df0bf4c..43ec9597 100644 --- a/docs-web/pom.xml +++ b/docs-web/pom.xml @@ -203,6 +203,53 @@ + + + stress + + + env + stress + + + + + + + src/stress/resources + false + + **/config.properties + + + + src/stress/resources + true + + **/config.properties + + + + + + + org.mortbay.jetty + jetty-maven-plugin + + 0 + + /docs-web + target/classes;../docs-core/target/classes + src/stress/main/webapp/web-override.xml + + STOPKEY + 1099 + + + + + + prod diff --git a/docs-web/src/stress/main/webapp/web-override.xml b/docs-web/src/stress/main/webapp/web-override.xml new file mode 100644 index 00000000..ea56b8c9 --- /dev/null +++ b/docs-web/src/stress/main/webapp/web-override.xml @@ -0,0 +1,16 @@ + + + + + + default + + useFileMappedBuffer + false + + + diff --git a/docs-web/src/stress/resources/config.properties b/docs-web/src/stress/resources/config.properties new file mode 100644 index 00000000..f935e8fa --- /dev/null +++ b/docs-web/src/stress/resources/config.properties @@ -0,0 +1,3 @@ +api.current_version=${project.version} +api.min_version=1.0 +db.version=10 \ No newline at end of file diff --git a/docs-web/src/stress/resources/hibernate.properties b/docs-web/src/stress/resources/hibernate.properties new file mode 100644 index 00000000..b6b34941 --- /dev/null +++ b/docs-web/src/stress/resources/hibernate.properties @@ -0,0 +1 @@ +\ugggg \ No newline at end of file diff --git a/docs-web/src/stress/resources/log4j.properties b/docs-web/src/stress/resources/log4j.properties new file mode 100644 index 00000000..0b05e8e9 --- /dev/null +++ b/docs-web/src/stress/resources/log4j.properties @@ -0,0 +1,8 @@ +log4j.rootCategory=WARN, CONSOLE, MEMORY +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%d{DATE} %p %l %m %n +log4j.appender.MEMORY=com.sismics.util.log4j.MemoryAppender +log4j.appender.MEMORY.size=1000 + +log4j.logger.com.sismics=DEBUG