← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13284: Added debug util used to put markers in database log files

 

------------------------------------------------------------
revno: 13284
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-17 18:58:55 +0100
message:
  Added debug util used to put markers in database log files
added:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/Debugger.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/DebuggerImpl.java
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.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
=== added directory 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug'
=== added file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/Debugger.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/Debugger.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/Debugger.java	2013-12-17 17:58:55 +0000
@@ -0,0 +1,6 @@
+package org.hisp.dhis.system.debug;
+
+public interface Debugger
+{
+    void markDbLog( String key );
+}

=== added file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/DebuggerImpl.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/DebuggerImpl.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/debug/DebuggerImpl.java	2013-12-17 17:58:55 +0000
@@ -0,0 +1,18 @@
+package org.hisp.dhis.system.debug;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.transaction.annotation.Transactional;
+
+public class DebuggerImpl
+    implements Debugger
+{
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+    
+    @Transactional
+    public void markDbLog( String key )
+    {
+        jdbcTemplate.queryForObject( "select count(*) from attribute where uid = '" + key + "'", Integer.class );
+    }
+}

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml	2012-12-14 13:46:47 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml	2013-12-17 17:58:55 +0000
@@ -29,4 +29,6 @@
 
   <bean id="notifier" class="org.hisp.dhis.system.notification.InMemoryNotifier" />
 
+  <bean id="debugger" class="org.hisp.dhis.system.debug.DebuggerImpl" />
+
 </beans>