More notes

This commit is contained in:
James Agnew 2017-09-26 19:05:53 -04:00
parent 2085e30cb4
commit ac7074ffdd
2 changed files with 101 additions and 39 deletions

View File

@ -1,40 +1,40 @@
package ca.uhn.fhir.jpa.config;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import net.ttddyy.dsproxy.listener.logging.SLF4JLogLevel;
import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder;
import org.apache.commons.dbcp2.BasicDataSource;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.apache.commons.dbcp2.BasicDataSource;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.context.annotation.*;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import net.ttddyy.dsproxy.support.ProxyDataSourceBuilder;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
@Configuration
@EnableTransactionManagement()
public class TestR4Config extends BaseJavaConfigR4 {
static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TestR4Config.class);
private Exception myLastStackTrace;
@Bean()
public DaoConfig daoConfig() {
return new DaoConfig();
}
private Exception myLastStackTrace;
@Bean()
public DataSource dataSource() {
BasicDataSource retVal = new BasicDataSource() {
@ -65,20 +65,20 @@ public class TestR4Config extends BaseJavaConfigR4 {
}
private void logGetConnectionStackTrace() {
StringBuilder b = new StringBuilder();
b.append("Last connection request stack trace:");
for (StackTraceElement next : myLastStackTrace.getStackTrace()) {
b.append("\n ");
b.append(next.getClassName());
b.append(".");
b.append(next.getMethodName());
b.append("(");
b.append(next.getFileName());
b.append(":");
b.append(next.getLineNumber());
b.append(")");
}
ourLog.info(b.toString());
StringBuilder b = new StringBuilder();
b.append("Last connection request stack trace:");
for (StackTraceElement next : myLastStackTrace.getStackTrace()) {
b.append("\n ");
b.append(next.getClassName());
b.append(".");
b.append(next.getMethodName());
b.append("(");
b.append(next.getFileName());
b.append(":");
b.append(next.getLineNumber());
b.append(")");
}
ourLog.info(b.toString());
}
};
@ -97,11 +97,11 @@ public class TestR4Config extends BaseJavaConfigR4 {
retVal.setMaxTotal(maxThreads);
DataSource dataSource = ProxyDataSourceBuilder
.create(retVal)
// .logQueryBySlf4j(SLF4JLogLevel.INFO, "SQL")
.logSlowQueryBySlf4j(10, TimeUnit.SECONDS)
.countQuery()
.build();
.create(retVal)
.logQueryBySlf4j(SLF4JLogLevel.INFO, "SQL")
.logSlowQueryBySlf4j(10, TimeUnit.SECONDS)
.countQuery()
.build();
return dataSource;
}

View File

@ -221,6 +221,68 @@
client framework which has been tailed specifically to run on Android.
</td>
</tr>
<tr><td style="text-align: center; font-size: 1.2em; background: #DDE; padding: 3px;" colspan="2">Validation</td></tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-validator</td>
<td>
This module contains the FHIR Profile Validator, which is used to
validate resource instances against FHIR Profiles (StructureDefinitions,
ValueSets, CodeSystems, etc.).
</td>
</tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-validation-resources-dstu2</td>
<td>
This module contains the StructureDefinitions, ValueSets, CodeSystems, Schemas,
and Schematrons for FHIR DSTU2
</td>
</tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-validation-resources-dstu2.1</td>
<td>
This module contains the StructureDefinitions, ValueSets, CodeSystems, Schemas,
and Schematrons for FHIR DSTU2.1
</td>
</tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-validation-resources-dstu3</td>
<td>
This module contains the StructureDefinitions, ValueSets, CodeSystems, Schemas,
and Schematrons for FHIR DSTU3
</td>
</tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-validation-resources-r4</td>
<td>
This module contains the StructureDefinitions, ValueSets, CodeSystems, Schemas,
and Schematrons for FHIR R4
</td>
</tr>
<tr><td style="text-align: center; font-size: 1.2em; background: #DDE; padding: 3px;" colspan="2">Server</td></tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-server</td>
<td>
This module contains the HAPI FHIR Server framework, which can be used to
develop FHIR compliant servers against your own data storage layer.
</td>
</tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-jpaserver-base</td>
<td>
This module contains the HAPI FHIR "JPA Server", which is a complete
FHIR server solution including a database and implementations of many
advanced FHIR server features.
</td>
</tr>
<tr>
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-testpage-overlay</td>
<td>
This module contains the web based "testpage overlay", which is the
UI that powers our
<a href="http://fhirtest.uhn.ca">Public Demo Server</a>
and can also be added to your applications.
</td>
</tr>
</tbody>
</table>
</section>