diff --git a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/Generator.java b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/Generator.java
index 1973584..3925e02 100644
--- a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/Generator.java
+++ b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/Generator.java
@@ -93,6 +93,9 @@
                 if (line.contains("@E@")) {
                     line = line.replace("@E@", resource.name);
                 }
+                if (line.contains("@DEBUG@")) {
+                    line = line.replace("@DEBUG@", Boolean.toString(debug));
+                }
                 if (line.contains("@CONSTS@")) {
                     resource.appendConstants(sb, indent, 1);
                     sb.append('\n');
@@ -143,6 +146,9 @@
                 if (line.contains("@E@")) {
                     line = line.replace("@E@", resource.name);
                 }
+                if (line.contains("@DEBUG@")) {
+                    line = line.replace("@DEBUG@", Boolean.toString(debug));
+                }
                 if (line.contains("@METHODS@")) {
                     for (int i = 0; i < resource.size(); ++i) {
                         final Field field = resource.fields.get(i);
diff --git a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/RecordManagerGeneratorMojo.java b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/RecordManagerGeneratorMojo.java
index 8a7965a..577d871 100644
--- a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/RecordManagerGeneratorMojo.java
+++ b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/java/edu/uci/ics/asterix/recordmanagergenerator/RecordManagerGeneratorMojo.java
@@ -17,13 +17,13 @@
 
 import java.io.File;
 import java.io.FileWriter;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 
 /**
  * @goal generate-record-manager
@@ -32,7 +32,12 @@
  */
 public class RecordManagerGeneratorMojo extends AbstractMojo {
     
-    private static final boolean DEBUG = true;
+    /**
+     * parameter injected from pom.xml
+     * 
+     * @parameter
+     */
+    private boolean debug;
     /**
      * parameter injected from pom.xml
      * 
@@ -62,7 +67,14 @@
 
     private Map<String, RecordType> typeMap;
 
-    public RecordManagerGeneratorMojo() {
+    public RecordManagerGeneratorMojo() {        
+    }
+
+    private void defineRecordTypes() {
+        if (debug) {
+            getLog().info("generating debug code");
+        }
+
         typeMap = new HashMap<String, RecordType>();
 
         RecordType resource = new RecordType("Resource");
@@ -73,7 +85,7 @@
         resource.addField("max mode", RecordType.Type.INT, "LockMode.NL");
         resource.addField("dataset id", RecordType.Type.INT, null);
         resource.addField("pk hash val", RecordType.Type.INT, null);
-        if (DEBUG) resource.addField("alloc id", RecordType.Type.SHORT, null, true);
+        resource.addField("alloc id", RecordType.Type.SHORT, null, true);
 
         typeMap.put(resource.name, resource);
 
@@ -84,7 +96,7 @@
         request.addField("next job request", RecordType.Type.GLOBAL, null);
         request.addField("next request", RecordType.Type.GLOBAL, null);
         request.addField("lock mode", RecordType.Type.INT, null);
-        if (DEBUG) request.addField("alloc id", RecordType.Type.SHORT, null, true);
+        request.addField("alloc id", RecordType.Type.SHORT, null, true);
 
         typeMap.put(request.name, request);
 
@@ -93,16 +105,18 @@
         job.addField("last waiter", RecordType.Type.GLOBAL, "-1");
         job.addField("last upgrader", RecordType.Type.GLOBAL, "-1");
         job.addField("job id", RecordType.Type.INT, null);
-        if (DEBUG) job.addField("alloc id", RecordType.Type.SHORT, null, true);
+        job.addField("alloc id", RecordType.Type.SHORT, null, true);
 
         typeMap.put(job.name, job);
     }
 
-    public void execute() throws MojoExecutionException {
+    public void execute() throws MojoExecutionException, MojoFailureException {
         if (!outputDir.exists()) {
             outputDir.mkdirs();
         }
 
+        defineRecordTypes();
+
         for (int i = 0; i < recordTypes.length; ++i) {
             final String recordType = recordTypes[i];
 
@@ -116,26 +130,27 @@
         }
     }
 
-    private void generateSource(Generator.Manager mgrType, String template, String recordType) {
+    private void generateSource(Generator.Manager mgrType, String template, String recordType) throws MojoFailureException {
+        InputStream is = getClass().getClassLoader().getResourceAsStream(template);
+        if (is == null) {
+            throw new MojoFailureException("template '" + template + "' not found in classpath");
+        }
+
+        StringBuilder sb = new StringBuilder();
+        File outputFile = new File(outputDir, recordType + template);
+
         try {
-            InputStream is = getClass().getClassLoader().getResourceAsStream(template);
-            if (is == null) {
-                throw new IllegalStateException();
-            }
-
-            StringBuilder sb = new StringBuilder();
-            Generator.generateSource(mgrType, typeMap.get(recordType), is, sb, DEBUG);
-
-            is.close();
-
-            File outputFile = new File(outputDir, recordType + template);
             getLog().info("generating " + outputFile.toString());
 
+            Generator.generateSource(mgrType, typeMap.get(recordType), is, sb, debug);
+            is.close();
+
             FileWriter outWriter = new FileWriter(outputFile);
             outWriter.write(sb.toString());
             outWriter.close();
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
+        } catch (Exception ex) {
+            getLog().error(ex);
+            throw new MojoFailureException("failed to generate " + outputFile.toString());
         }
     }
 }
diff --git a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/ArenaManager.java b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/ArenaManager.java
index 9a6492c..e7d5590 100644
--- a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/ArenaManager.java
+++ b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/ArenaManager.java
@@ -17,11 +17,11 @@
 
 import java.util.ArrayList;
 
-import edu.uci.ics.asterix.transaction.management.service.locking.@E@RecordManager.Buffer.Alloc;
+import edu.uci.ics.asterix.transaction.management.service.locking.AllocInfo;
 
 public class @E@ArenaManager {
     
-    public static final boolean TRACK_ALLOC = true;
+    public static final boolean TRACK_ALLOC = @DEBUG@;
 
     private final int noArenas;
     private ArrayList<@E@RecordManager> arenas;
@@ -103,12 +103,11 @@
         final int refAllocId = allocId(slotNum);
         final short curAllocId = getAllocId(slotNum);
         if (refAllocId != curAllocId) {
-            System.err.println("checkSlot(" + slotNum + "): " + refAllocId);
             String msg = "reference to slot " + slotNum
                 + " of arena " + arenaId(slotNum) + " refers to version " 
                 + Integer.toHexString(refAllocId) + " current version is "
                 + Integer.toHexString(curAllocId);
-            Alloc a = getAlloc(slotNum);
+            AllocInfo a = getAllocInfo(slotNum);
             if (a != null) {
                 msg += "\n" + a.toString();
             }
@@ -116,9 +115,9 @@
         }
     }
     
-    public Alloc getAlloc(long slotNum) {
+    public AllocInfo getAllocInfo(long slotNum) {
         final int arenaId = arenaId(slotNum);
-        return get(arenaId).getAlloc(localId(slotNum));
+        return get(arenaId).getAllocInfo(localId(slotNum));
     }
     
     static class LocalManager {
diff --git a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/RecordManager.java b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/RecordManager.java
index 7fa3ed7..54a9844 100644
--- a/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/RecordManager.java
+++ b/asterix-maven-plugins/record-manager-generator-maven-plugin/src/main/resources/RecordManager.java
@@ -20,13 +20,13 @@
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 
-import edu.uci.ics.asterix.transaction.management.service.locking.@E@RecordManager.Buffer.Alloc;
+import edu.uci.ics.asterix.transaction.management.service.locking.AllocInfo;
 import edu.uci.ics.asterix.transaction.management.service.transaction.TransactionManagementConstants.LockManagerConstants.LockMode;
 
 public class @E@RecordManager {
 
     public static final int SHRINK_TIMER_THRESHOLD = 120000; //2min
-    public static final boolean TRACK_ALLOC = false;
+    public static final boolean TRACK_ALLOC = @DEBUG@;
     
     static final int NO_SLOTS = 10;
     static final int NEXT_FREE_SLOT_OFFSET = 0;
@@ -166,7 +166,7 @@
 
     @METHODS@
     
-    public Alloc getAlloc(int slotNum) {
+    public AllocInfo getAllocInfo(int slotNum) {
         final Buffer buf = buffers.get(slotNum / NO_SLOTS);
         if (buf.allocList == null) {
             return null;
@@ -199,7 +199,7 @@
         private int freeSlotNum;
         private int occupiedSlots = -1; //-1 represents 'deinitialized' state.
         
-        ArrayList<Alloc> allocList;
+        ArrayList<AllocInfo> allocList;
         
         Buffer() {
             initialize();
@@ -216,9 +216,9 @@
             setNextFreeSlot(NO_SLOTS - 1, -1); //-1 represents EOL(end of link)
             
             if (TRACK_ALLOC) {
-                allocList = new ArrayList<Alloc>(NO_SLOTS);
+                allocList = new ArrayList<AllocInfo>(NO_SLOTS);
                 for (int i = 0; i < NO_SLOTS; ++i) {
-                    allocList.add(new Alloc());
+                    allocList.add(new AllocInfo());
                 }
             }
         }
@@ -288,37 +288,6 @@
             final int itemOffset = (slotNum % NO_SLOTS) * ITEM_SIZE;
             // @CHECK_SLOT@
         }
-        
-        static class Alloc {
-            String alloc;
-            String free;
-            
-            void alloc() {
-                alloc = getStackTrace();
-            }
-            
-            void free() {
-                free = getStackTrace();
-            }
-
-            private String getStackTrace() {
-                StringWriter sw = new StringWriter();
-                PrintWriter pw = new PrintWriter(sw);
-                new Exception().printStackTrace(pw);
-                pw.close();
-                String res = sw.toString();
-                // remove first 3 lines
-                int nlPos = 0;
-                for (int i = 0; i < 3; ++i) {
-                    nlPos = res.indexOf('\n', nlPos) + 1; 
-                }
-                return res.substring(nlPos);
-            }
-            
-            public String toString() {
-                return "allocation stack:\n" + alloc + "\nfree stack\n" + free;
-            }
-        }
     }
     
 }
diff --git a/asterix-transactions/pom.xml b/asterix-transactions/pom.xml
index 8b2eb06..13a01a6 100644
--- a/asterix-transactions/pom.xml
+++ b/asterix-transactions/pom.xml
@@ -38,6 +38,7 @@
                 <artifactId>record-manager-generator-maven-plugin</artifactId>
                 <version>0.8.1-SNAPSHOT</version>
                 <configuration>
+                    <debug>false</debug>
                     <arenaManagerTemplate>ArenaManager.java</arenaManagerTemplate>
                     <recordManagerTemplate>RecordManager.java</recordManagerTemplate>
                     <recordTypes>
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/AllocInfo.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/AllocInfo.java
new file mode 100644
index 0000000..dfba774
--- /dev/null
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/locking/AllocInfo.java
@@ -0,0 +1,35 @@
+package edu.uci.ics.asterix.transaction.management.service.locking;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+public class AllocInfo {
+    String alloc;
+    String free;
+    
+    void alloc() {
+        alloc = getStackTrace();
+    }
+    
+    void free() {
+        free = getStackTrace();
+    }
+
+    private String getStackTrace() {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        new Exception().printStackTrace(pw);
+        pw.close();
+        String res = sw.toString();
+        // remove first 3 lines
+        int nlPos = 0;
+        for (int i = 0; i < 3; ++i) {
+            nlPos = res.indexOf('\n', nlPos) + 1; 
+        }
+        return res.substring(nlPos);
+    }
+    
+    public String toString() {
+        return "allocation stack:\n" + alloc + "\nfree stack\n" + free;
+    }
+}
