#24: High performance is not going to happen on HSQLDB

This commit is contained in:
jendib 2015-09-02 01:12:33 +02:00
parent 36b5bf3bb2
commit 6d73554967
9 changed files with 82 additions and 7 deletions

View File

@ -183,7 +183,7 @@ public class DocumentDao {
Map<String, Object> parameterMap = new HashMap<String, Object>(); Map<String, Object> parameterMap = new HashMap<String, Object>();
List<String> criteriaList = new ArrayList<String>(); List<String> criteriaList = new ArrayList<String>();
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(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(" (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 "); sb.append(" from T_DOCUMENT d ");

View File

@ -104,10 +104,10 @@ public class DirectoryUtil {
*/ */
private static File getDataSubDirectory(String subdirectory) { private static File getDataSubDirectory(String subdirectory) {
File baseDataDir = getBaseDataDirectory(); File baseDataDir = getBaseDataDirectory();
File faviconDirectory = new File(baseDataDir.getPath() + File.separator + subdirectory); File directory = new File(baseDataDir.getPath() + File.separator + subdirectory);
if (!faviconDirectory.isDirectory()) { if (!directory.isDirectory()) {
faviconDirectory.mkdirs(); directory.mkdirs();
} }
return faviconDirectory; return directory;
} }
} }

View File

@ -71,7 +71,7 @@ public final class EMF {
properties.load(is); properties.load(is);
return properties; return properties;
} }
} catch (IOException e) { } catch (IOException | IllegalArgumentException e) {
log.error("Error reading hibernate.properties", e); log.error("Error reading hibernate.properties", e);
} }

View File

@ -24,7 +24,7 @@
<org.slf4j.version>1.6.4</org.slf4j.version> <org.slf4j.version>1.6.4</org.slf4j.version>
<org.slf4j.jcl-over-slf4j.version>1.6.6</org.slf4j.jcl-over-slf4j.version> <org.slf4j.jcl-over-slf4j.version>1.6.6</org.slf4j.jcl-over-slf4j.version>
<junit.junit.version>4.7</junit.junit.version> <junit.junit.version>4.7</junit.junit.version>
<org.hsqldb.hsqldb.version>2.3.0</org.hsqldb.hsqldb.version> <org.hsqldb.hsqldb.version>2.3.3</org.hsqldb.hsqldb.version>
<com.sun.jersey.version>1.17</com.sun.jersey.version> <com.sun.jersey.version>1.17</com.sun.jersey.version>
<org.mindrot.jbcrypt>0.3m</org.mindrot.jbcrypt> <org.mindrot.jbcrypt>0.3m</org.mindrot.jbcrypt>
<org.subethamail.subethasmtp.version>3.1.6</org.subethamail.subethasmtp.version> <org.subethamail.subethasmtp.version>3.1.6</org.subethamail.subethasmtp.version>

View File

@ -203,6 +203,53 @@
</build> </build>
</profile> </profile>
<!-- Stress profile -->
<profile>
<id>stress</id>
<activation>
<property>
<name>env</name>
<value>stress</value>
</property>
</activation>
<build>
<resources>
<resource>
<directory>src/stress/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/config.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src/stress/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/config.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<webAppConfig>
<contextPath>/docs-web</contextPath>
<extraClasspath>target/classes;../docs-core/target/classes</extraClasspath>
<overrideDescriptor>src/stress/main/webapp/web-override.xml</overrideDescriptor>
</webAppConfig>
<stopKey>STOPKEY</stopKey>
<stopPort>1099</stopPort>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Production profile --> <!-- Production profile -->
<profile> <profile>
<id>prod</id> <id>prod</id>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="docs"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- Override init parameter to avoid nasty file locking issue on windows. -->
<servlet>
<servlet-name>default</servlet-name>
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
</web-app>

View File

@ -0,0 +1,3 @@
api.current_version=${project.version}
api.min_version=1.0
db.version=10

View File

@ -0,0 +1 @@
\ugggg

View File

@ -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