details: /erp/erp/devel/pi/rev/1298b6ae25cd changeset: 4873:1298b6ae25cd user: Martin Taal <martin.taal <at> openbravo.com> date: Mon Sep 07 20:01:40 2009 +0200 summary: Improved display of exception message
details: /erp/erp/devel/pi/rev/4356ae1b61b0 changeset: 4874:4356ae1b61b0 user: Martin Taal <martin.taal <at> openbravo.com> date: Mon Sep 07 20:02:25 2009 +0200 summary: Prevent exception in rollback when conn.isClosed details: /erp/erp/devel/pi/rev/5510039d78e3 changeset: 4875:5510039d78e3 user: Martin Taal <martin.taal <at> openbravo.com> date: Mon Sep 07 20:02:45 2009 +0200 summary: Set newObject to false in postFlush diffstat: src-core/src/org/openbravo/database/ConnectionProviderImpl.java | 7 +++++++ src/org/openbravo/dal/core/OBInterceptor.java | 10 ++++++++++ src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java | 10 +++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diffs (78 lines): diff -r 07e911a9189e -r 5510039d78e3 src-core/src/org/openbravo/database/ConnectionProviderImpl.java --- a/src-core/src/org/openbravo/database/ConnectionProviderImpl.java Mon Sep 07 16:56:24 2009 +0200 +++ b/src-core/src/org/openbravo/database/ConnectionProviderImpl.java Mon Sep 07 20:02:45 2009 +0200 @@ -240,6 +240,13 @@ public void releaseRollbackConnection(Connection conn) throws SQLException { if (conn == null) return; + // prevent extra exception if the connection is already closed + // especially needed here because rollback occurs in case of + // application exceptions also. If the conn.isClosed and a rollback + // is done then the real app exception is hidden. + if (conn.isClosed()) { + return; + } conn.rollback(); releaseConnection(conn); } diff -r 07e911a9189e -r 5510039d78e3 src/org/openbravo/dal/core/OBInterceptor.java --- a/src/org/openbravo/dal/core/OBInterceptor.java Mon Sep 07 16:56:24 2009 +0200 +++ b/src/org/openbravo/dal/core/OBInterceptor.java Mon Sep 07 20:02:45 2009 +0200 @@ -27,6 +27,7 @@ import java.io.Serializable; import java.sql.SQLException; import java.util.Date; +import java.util.Iterator; import org.apache.log4j.Logger; import org.hibernate.EmptyInterceptor; @@ -331,4 +332,13 @@ } } } + + // after flushing an object is not new anymore + public void postFlush(Iterator entities) { + while (entities.hasNext()) { + final BaseOBObject bob = (BaseOBObject) entities.next(); + bob.setNewOBObject(false); + } + } + } \ No newline at end of file diff -r 07e911a9189e -r 5510039d78e3 src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java --- a/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java Mon Sep 07 16:56:24 2009 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/InitialOrgSetup.java Mon Sep 07 20:02:45 2009 +0200 @@ -363,6 +363,7 @@ strModules, bProduct, bBPartner, bProject, bCampaign, bSalesRegion, strCreateAccounting); if (!strReferenceData.equals("")) { releaseRollbackConnection(conn); + strError = Utility.messageBD(this, "CreateReferenceDataFailed", vars.getLanguage()); m_info.append(SALTO_LINEA).append( Utility.messageBD(this, "CreateReferenceDataFailed", vars.getLanguage())).append( SALTO_LINEA); @@ -1109,17 +1110,20 @@ if (myResult.getLogMessages() != null && !myResult.getLogMessages().equals("") && !myResult.getLogMessages().equals("null")) { m_info.append(SALTO_LINEA).append("LOG:").append(SALTO_LINEA); - m_info.append(SALTO_LINEA).append(myResult.getLogMessages()).append(SALTO_LINEA); + m_info.append(SALTO_LINEA).append( + myResult.getLogMessages().replaceAll("\\\n", SALTO_LINEA)).append(SALTO_LINEA); } if (myResult.getWarningMessages() != null && !myResult.getWarningMessages().equals("") && !myResult.getWarningMessages().equals("null")) { m_info.append(SALTO_LINEA).append("WARNINGS:").append(SALTO_LINEA); - m_info.append(SALTO_LINEA).append(myResult.getWarningMessages()).append(SALTO_LINEA); + m_info.append(SALTO_LINEA).append( + myResult.getWarningMessages().replaceAll("\\\n", SALTO_LINEA)).append(SALTO_LINEA); } if (myResult.getErrorMessages() != null && !myResult.getErrorMessages().equals("") && !myResult.getErrorMessages().equals("null")) { m_info.append(SALTO_LINEA).append("ERRORS:").append(SALTO_LINEA); - m_info.append(SALTO_LINEA).append(myResult.getErrorMessages()).append(SALTO_LINEA); + m_info.append(SALTO_LINEA).append( + myResult.getErrorMessages().replaceAll("\\\n", SALTO_LINEA)).append(SALTO_LINEA); } if (myResult.getErrorMessages() != null && !myResult.getErrorMessages().equals("") && !myResult.getErrorMessages().equals("null")) ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits