← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16775: set flush frequence in event import to 20 instead of 100 to speed up import

 

------------------------------------------------------------
revno: 16775
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-09-23 14:15:21 +0700
message:
  set flush frequence in event import to 20 instead of 100 to speed up import
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java


--
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/JacksonEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java	2014-04-04 21:24:04 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java	2014-09-23 07:15:21 +0000
@@ -66,6 +66,8 @@
     @Autowired
     private SessionFactory sessionFactory;
 
+    private final int FLUSH_FREQUENCY = 20;
+
     // -------------------------------------------------------------------------
     // EventService Impl
     // -------------------------------------------------------------------------
@@ -141,7 +143,7 @@
             {
                 importSummaries.addImportSummary( addEvent( event, importOptions ) );
 
-                if ( counter % 100 == 0 )
+                if ( counter % FLUSH_FREQUENCY == 0 )
                 {
                     sessionFactory.getCurrentSession().flush();
                     sessionFactory.getCurrentSession().clear();
@@ -217,7 +219,7 @@
             {
                 importSummaries.addImportSummary( addEvent( event, importOptions ) );
 
-                if ( counter % 100 == 0 )
+                if ( counter % FLUSH_FREQUENCY == 0 )
                 {
                     sessionFactory.getCurrentSession().flush();
                     sessionFactory.getCurrentSession().clear();