dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27181
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13491: Enabling basic query caching of Program and ProgramStage
------------------------------------------------------------
revno: 13491
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-30 13:36:02 +0100
message:
Enabling basic query caching of Program and ProgramStage
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2013-12-30 12:04:30 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2013-12-30 12:36:02 +0000
@@ -595,7 +595,7 @@
return !programsByCurrentUser.contains( program );
}
- private boolean validateDataElement( DataElement dataElement, String value, ImportSummary importSummary )
+ private boolean validateDataValue( DataElement dataElement, String value, ImportSummary importSummary )
{
String status = ValidationUtils.dataValueIsValid( value, dataElement );
@@ -759,7 +759,7 @@
}
else
{
- if ( validateDataElement( dataElement, dataValue.getValue(), importSummary ) )
+ if ( validateDataValue( dataElement, dataValue.getValue(), importSummary ) )
{
String dataValueStoredBy = dataValue.getStoredBy() != null ? dataValue.getStoredBy() : storedBy;
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-11-27 14:32:10 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-12-30 12:36:02 +0000
@@ -44,6 +44,7 @@
class="org.hisp.dhis.program.hibernate.HibernateProgramStageStore">
<property name="clazz" value="org.hisp.dhis.program.ProgramStage" />
<property name="sessionFactory" ref="sessionFactory" />
+ <property name="cacheable" value="true" />
</bean>
<bean id="org.hisp.dhis.program.ProgramStageSectionStore"
@@ -55,6 +56,7 @@
<bean id="org.hisp.dhis.program.ProgramStore" class="org.hisp.dhis.program.hibernate.HibernateProgramStore">
<property name="clazz" value="org.hisp.dhis.program.Program" />
<property name="sessionFactory" ref="sessionFactory" />
+ <property name="cacheable" value="true" />
<property name="userService" ref="org.hisp.dhis.user.UserService" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
</bean>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2013-12-28 15:15:11 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml 2013-12-30 12:36:02 +0000
@@ -8,6 +8,8 @@
<hibernate-mapping>
<class name="org.hisp.dhis.program.Program" table="program">
+ <cache usage="read-write" />
+
<id name="id" column="programid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2013-12-30 12:36:02 +0000
@@ -8,7 +8,9 @@
<hibernate-mapping>
<class name="org.hisp.dhis.program.ProgramStage" table="programstage">
- <id name="id" column="programstageid">
+ <cache usage="read-write" />
+
+ <id name="id" column="programstageid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml 2013-12-17 12:48:48 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml 2013-12-30 12:36:02 +0000
@@ -117,6 +117,10 @@
<cache name="org.hisp.dhis.dataset.LockException" maxElementsInMemory="1000" />
<cache name="org.hisp.dhis.filter.MetaDataFilter" maxElementsInMemory="100" />
+
+ <cache name="org.hisp.dhis.program.Program" maxElementsInMemory="100" />
+
+ <cache name="org.hisp.dhis.program.ProgramStage" maxElementsInMemory="500" />
<!-- Hibernate Associations -->