[commit] r1852 - in trunk: Paradigms/MetaGME/MetaInterpreter SDK/BON/Common

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Mar 7 11:30:40 CST 2012


Author: ksmyth
Date: Wed Mar  7 11:30:39 2012
New Revision: 1852

Log:
Use non-nested txs; should be faster

Modified:
   trunk/Paradigms/MetaGME/MetaInterpreter/BON2Component.cpp
   trunk/Paradigms/MetaGME/MetaInterpreter/MetaInterpreter.vcxproj
   trunk/Paradigms/MetaGME/MetaInterpreter/StdAfx.h
   trunk/SDK/BON/Common/BONImpl.cpp
   trunk/SDK/BON/Common/BONImpl.h

Modified: trunk/Paradigms/MetaGME/MetaInterpreter/BON2Component.cpp
==============================================================================
--- trunk/Paradigms/MetaGME/MetaInterpreter/BON2Component.cpp	Wed Mar  7 11:30:22 2012	(r1851)
+++ trunk/Paradigms/MetaGME/MetaInterpreter/BON2Component.cpp	Wed Mar  7 11:30:39 2012	(r1852)
@@ -354,6 +354,7 @@
 void Component::invokeEx( Project& project, FCO& currentFCO, const std::set<FCO>& setSelectedFCOs, long lParam )
 {
 	project->setAutoCommit(false);
+	project->beginOnly(TRANSACTION_GENERAL);
 	// ======================
 	// Insert application specific code here
 	global_vars.silent_mode = (lParam == GME_SILENT_MODE);
@@ -372,13 +373,16 @@
 			if( AfxMessageBox( (LPCTSTR)msg, MB_YESNO | MB_ICONWARNING) != IDYES)
 			{
 				project->consoleMsg("[MetaInterpreter] Intepretation stopped by the user.", MSG_NORMAL);
+				project->abortOnly();
 				return;
 			}
 		}
 	}
 	if ( Dumper::selectOutputFiles( project, m_projectName, m_dir) > 1)
 	{
-		if( !global_vars.silent_mode) project->consoleMsg("[MetaInterpreter] Output file name selection cancelled by the user or other file operation failed.", MSG_NORMAL);
+		if (!global_vars.silent_mode)
+			project->consoleMsg("[MetaInterpreter] Output file name selection cancelled by the user or other file operation failed.", MSG_NORMAL);
+		project->abortOnly();
 		return;
 	}
 
@@ -477,6 +481,10 @@
 	global_vars.err.flushit();
 	global_vars.err.close();
 	global_vars.err.m_proj = (Project) 0;
+	project->commit();
+	CComPtr<IMgaProject> pproject = (IMgaProject*)project->getProjectI();
+	project = NULL;
+	pproject->CommitTransaction();
 }
 
 // ====================================================

Modified: trunk/Paradigms/MetaGME/MetaInterpreter/MetaInterpreter.vcxproj
==============================================================================
--- trunk/Paradigms/MetaGME/MetaInterpreter/MetaInterpreter.vcxproj	Wed Mar  7 11:30:22 2012	(r1851)
+++ trunk/Paradigms/MetaGME/MetaInterpreter/MetaInterpreter.vcxproj	Wed Mar  7 11:30:39 2012	(r1852)
@@ -81,6 +81,7 @@
     <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(MSBuildThisFileDirectory.GetHashCode())</TargetName>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <CustomBuildStep />

Modified: trunk/Paradigms/MetaGME/MetaInterpreter/StdAfx.h
==============================================================================
--- trunk/Paradigms/MetaGME/MetaInterpreter/StdAfx.h	Wed Mar  7 11:30:22 2012	(r1851)
+++ trunk/Paradigms/MetaGME/MetaInterpreter/StdAfx.h	Wed Mar  7 11:30:39 2012	(r1852)
@@ -8,6 +8,7 @@
 #pragma once
 
 #define TEST_META_CONFORMANCE_INSIDE_BON // by ZolMol
+#define BON_CUSTOM_TRANSACTIONS 1
 
 #ifndef VC_EXTRALEAN
 #define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers
@@ -31,6 +32,8 @@
 #include "BON.h"
 #include "BONImpl.h"
 
+
+
 //{{AFX_INSERT_LOCATION}}
 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
 

Modified: trunk/SDK/BON/Common/BONImpl.cpp
==============================================================================
--- trunk/SDK/BON/Common/BONImpl.cpp	Wed Mar  7 11:30:22 2012	(r1851)
+++ trunk/SDK/BON/Common/BONImpl.cpp	Wed Mar  7 11:30:39 2012	(r1852)
@@ -457,10 +457,15 @@
 
 	void ProjectImpl::beginOnly()
 	{
+		beginOnly(TRANSACTION_GENERAL);
+	}
+
+	void ProjectImpl::beginOnly(transactiontype_enum mode)
+	{
 		if (!m_spTerritory) {
 			COMCHECK2( m_spProject, m_spProject->CreateTerritory( NULL, m_spTerritory.Addr() ) );
 		}
-		COMCHECK2( m_spProject, m_spProject->BeginTransaction( m_spTerritory ) );
+		COMCHECK2( m_spProject, m_spProject->BeginTransaction( m_spTerritory, mode ) );
 	}
 
 	void ProjectImpl::abort()
@@ -473,6 +478,11 @@
 		COMCHECK2( m_spProject, m_spProject->BeginTransaction( m_spTerritory ) );
 	}
 
+	void ProjectImpl::abortOnly()
+	{
+		COMCHECK2( m_spProject, m_spProject->AbortTransaction() );
+	}
+
 	bool ProjectImpl::isDestructionActive() const
 	{
 		return m_bIsDestructionActive;

Modified: trunk/SDK/BON/Common/BONImpl.h
==============================================================================
--- trunk/SDK/BON/Common/BONImpl.h	Wed Mar  7 11:30:22 2012	(r1851)
+++ trunk/SDK/BON/Common/BONImpl.h	Wed Mar  7 11:30:39 2012	(r1852)
@@ -152,7 +152,9 @@
 			void 					commit();
 			void 					commitOnly();
 			void 					beginOnly();
+			void 					beginOnly(transactiontype_enum mode);
 			void					abort();
+			void					abortOnly();
 			bool 					isDestructionActive() const;
 
 			ProjectPtr				getProjectI() const;


More information about the gme-commit mailing list