[commit] r2370 - trunk/GME/Mga

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Oct 1 14:13:18 CDT 2013


Author: ksmyth
Date: Tue Oct  1 14:13:18 2013
New Revision: 2370

Log:
Better ErrorInfo

Modified:
   trunk/GME/Mga/MgaConnection.cpp
   trunk/GME/Mga/MgaTrukk.h

Modified: trunk/GME/Mga/MgaConnection.cpp
==============================================================================
--- trunk/GME/Mga/MgaConnection.cpp	Tue Oct  1 14:13:08 2013	(r2369)
+++ trunk/GME/Mga/MgaConnection.cpp	Tue Oct  1 14:13:18 2013	(r2370)
@@ -75,7 +75,7 @@
 			}
 			if(endfco) {
 				CComPtr<IMgaConnPoint> tt;
-				COMTHROW(AddConnPoint(rolename, 1, endfco, refs, &tt));
+				COMRETURN_IN_TRANSACTION_MAYBE(AddConnPoint(rolename, 1, endfco, refs, &tt));
 			}
 	} COMCATCH_IN_TRANSACTION_MAYBE(;)
 }	

Modified: trunk/GME/Mga/MgaTrukk.h
==============================================================================
--- trunk/GME/Mga/MgaTrukk.h	Tue Oct  1 14:13:08 2013	(r2369)
+++ trunk/GME/Mga/MgaTrukk.h	Tue Oct  1 14:13:18 2013	(r2370)
@@ -377,6 +377,22 @@
 else \
 	return S_OK;
 
+#define COMRETURN_IN_TRANSACTION_MAYBE(hr) \
+	if (FAILED(hr)) { \
+		if (!(this->mgaproject->preferences & MGAPREF_NO_NESTED_TX)) \
+		{ \
+			HRESULT hrTx = ttt.Abort(); \
+			if (FAILED(hrTx)) return hrTx; \
+		} \
+		return hr; \
+	} else { \
+		if (!(this->mgaproject->preferences & MGAPREF_NO_NESTED_TX)) \
+			return ttt.Commit(); \
+		else \
+			return S_OK; \
+	}
+
+
 
 #define MODIFIED	{ if(mgaproject->opened < 1000) mgaproject->opened++; }
  


More information about the gme-commit mailing list