related to bug 19195: Better log when export trl query fails
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 28 Nov 2011 15:32:42 +0100
changeset 14751 c97041fdd8fe
parent 14750 5170deb9c581
child 14752 dd72bcec5a07
related to bug 19195: Better log when export trl query fails
src/org/openbravo/erpCommon/ad_forms/TranslationManager.java
--- a/src/org/openbravo/erpCommon/ad_forms/TranslationManager.java	Mon Nov 28 13:57:46 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/TranslationManager.java	Mon Nov 28 15:32:42 2011 +0100
@@ -369,6 +369,7 @@
       String rootDirectory, String moduleId, String moduleLanguage, String javaPackage, boolean trl) {
 
     Statement st = null;
+    StringBuffer sql = null;
     try {
       String trlTable = table;
       if (trl && !table.endsWith("_TRL"))
@@ -388,7 +389,7 @@
       }
 
       // Prepare query to retrieve translated rows
-      final StringBuffer sql = new StringBuffer("SELECT ");
+      sql = new StringBuffer("SELECT ");
       if (trl)
         sql.append("t.IsTranslated,");
       else
@@ -563,7 +564,7 @@
       transformer.transform(source, new StreamResult(osw));
       osw.close();
     } catch (final Exception e) {
-      log4j.error("Error exporting translation for table " + table, e);
+      log4j.error("Error exporting translation for table " + table + "\n" + sql, e);
     } finally {
       try {
         if (st != null)