You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by mm...@apache.org on 2021/08/28 21:42:35 UTC

[geode-native] branch GEODE-9559-demacroize-clicache created (now afe9584)

This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a change to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git.


      at afe9584  GEODE-9559: Forgot to rm _GFCLI_CACHEABLEHASHSET_DEF_GENERIC

This branch includes the following new commits:

     new b34490c  Demacroize: - _GF_MG_EXCEPTION_TRY2 - _GF_MG_EXCEPTION_CATCH_ALL2
     new 6b2a668  Demacroize: DEF3 and DEF4
     new 6f61439  GEODE-9559: Demacroize _GFCLI_CACHEABLE_KEY_DEF_NEW
     new c8af94e  GEODE-9559: Demacroize _GFCLI_CACHEABLEHASHSET_DEF_GENERIC
     new afe9584  GEODE-9559: Forgot to rm _GFCLI_CACHEABLEHASHSET_DEF_GENERIC

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[geode-native] 05/05: GEODE-9559: Forgot to rm _GFCLI_CACHEABLEHASHSET_DEF_GENERIC

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit afe9584917027e2c9e94db3fa8eb25e092a8cc3c
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Sat Aug 28 13:31:45 2021 -0700

    GEODE-9559: Forgot to rm _GFCLI_CACHEABLEHASHSET_DEF_GENERIC
---
 clicache/src/CacheableHashSet.hpp | 57 ---------------------------------------
 1 file changed, 57 deletions(-)

diff --git a/clicache/src/CacheableHashSet.hpp b/clicache/src/CacheableHashSet.hpp
index d3c42fb..920f1c6 100644
--- a/clicache/src/CacheableHashSet.hpp
+++ b/clicache/src/CacheableHashSet.hpp
@@ -604,63 +604,6 @@ namespace Apache
         };
       }
 
-#define _GFCLI_CACHEABLEHASHSET_DEF_GENERIC(m, HSTYPE)                               \
-	public ref class m : public Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::m), HSTYPE>      \
-            {                                                                       \
-      public:                                                                 \
-        /** <summary>
-      *  Allocates a new empty instance.
-      *  </summary>
-      */                                                                   \
-      inline m()                                                            \
-      : Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::m), HSTYPE>() {}                      \
-      \
-      /** <summary>
-       *  Allocates a new instance with the given size.
-       *  </summary>
-       *  <param name="size">the initial size of the new instance</param>
-       */                                                                   \
-       inline m(System::Int32 size)                                                 \
-       : Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::m), HSTYPE>(size) {}                  \
-       \
-       /** <summary>
-        *  Static function to create a new empty instance.
-        *  </summary>
-        */                                                                   \
-        inline static m^ Create()                                             \
-      {                                                                     \
-      return gcnew m();                                                   \
-      }                                                                     \
-      \
-      /** <summary>
-       *  Static function to create a new instance with the given size.
-       *  </summary>
-       */                                                                   \
-       inline static m^ Create(System::Int32 size)                                  \
-      {                                                                     \
-      return gcnew m(size);                                               \
-      }                                                                     \
-      \
-      /* <summary>
-       * Factory function to register this class.
-       * </summary>
-       */                                                                   \
-       static ISerializable^ CreateDeserializable()                        \
-      {                                                                     \
-      return gcnew m();                                                   \
-      }                                                                     \
-      \
-            internal:                                                               \
-              static ISerializable^ Create(std::shared_ptr<apache::geode::client::Serializable> obj)            \
-      {                                                                     \
-      return gcnew m(obj);                                                \
-      }                                                                     \
-      \
-            private:                                                                \
-              inline m(std::shared_ptr<apache::geode::client::Serializable> nativeptr)                            \
-              : Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::m), HSTYPE>(nativeptr) { }             \
-      };
-
       /// <summary>
       /// A mutable <c>ICacheableKey</c> hash set wrapper that can serve as
       /// a distributable object for caching.

[geode-native] 01/05: Demacroize: - _GF_MG_EXCEPTION_TRY2 - _GF_MG_EXCEPTION_CATCH_ALL2

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit b34490cad70b09fc22366941fce54197d2abac58
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Sat Aug 28 07:33:50 2021 -0700

    Demacroize:
    - _GF_MG_EXCEPTION_TRY2
    - _GF_MG_EXCEPTION_CATCH_ALL2
---
 clicache/src/Cache.cpp                          | 100 ++++-
 clicache/src/CacheFactory.cpp                   |  50 ++-
 clicache/src/CacheTransactionManager.cpp        | 160 +++++--
 clicache/src/CacheableHashSet.hpp               |  10 +-
 clicache/src/CqQuery.cpp                        |  70 ++-
 clicache/src/DataInput.cpp                      |  30 +-
 clicache/src/DistributedSystem.cpp              |  50 ++-
 clicache/src/ExceptionTypes.cpp                 | 125 +++---
 clicache/src/ExceptionTypes.hpp                 |  14 -
 clicache/src/Execution.cpp                      |  40 +-
 clicache/src/FunctionService.cpp                |  50 ++-
 clicache/src/LocalRegion.cpp                    | 330 +++++++++++---
 clicache/src/Log.cpp                            |  30 +-
 clicache/src/Pool.cpp                           |  20 +-
 clicache/src/PoolFactory.cpp                    | 240 ++++++++--
 clicache/src/Properties.cpp                     | 110 ++++-
 clicache/src/Query.cpp                          |  40 +-
 clicache/src/Region.cpp                         | 560 +++++++++++++++++++-----
 clicache/src/RegionAttributesFactory.cpp        |  40 +-
 clicache/src/RegionFactory.cpp                  |  40 +-
 clicache/src/ResultCollector.cpp                |  30 +-
 clicache/src/StructSet.cpp                      |  10 +-
 clicache/src/TypeRegistry.cpp                   |  30 +-
 clicache/src/UserFunctionExecutionException.cpp |  20 +-
 clicache/src/impl/AuthenticatedView.cpp         |  30 +-
 clicache/src/impl/GeodeDataInputStream.hpp      |  10 +-
 clicache/src/impl/GeodeDataOutputStream.hpp     |  20 +-
 27 files changed, 1758 insertions(+), 501 deletions(-)

diff --git a/clicache/src/Cache.cpp b/clicache/src/Cache.cpp
index 8cfbe52..2e6da5b 100644
--- a/clicache/src/Cache.cpp
+++ b/clicache/src/Cache.cpp
@@ -131,12 +131,18 @@ namespace Apache
 
       void Cache::Close( bool keepalive )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           m_nativeptr->get()->close( keepalive );
           Apache::Geode::Client::DistributedSystem::UnregisterBuiltinManagedTypes(this);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         finally
         {
 					CacheRegionHelper::getCacheImpl(m_nativeptr->get())->getPdxTypeRegistry()->clear();
@@ -148,7 +154,7 @@ namespace Apache
 
       void Cache::ReadyForEvents( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -159,13 +165,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TKey, class TValue>
       Client::IRegion<TKey,TValue>^ Cache::GetRegion( String^ path )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -176,7 +188,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -204,7 +222,7 @@ namespace Apache
 
       Client::QueryService^ Cache::GetQueryService( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -215,12 +233,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       Client::QueryService^ Cache::GetQueryService(String^ poolName )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -231,12 +255,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ Cache::CreateRegionFactory(RegionShortcut preDefinedRegionAttributes)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           auto preDefineRegionAttr = apache::geode::client::RegionShortcut(preDefinedRegionAttributes);
 
@@ -251,12 +281,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
           
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       IRegionService^ Cache::CreateAuthenticatedView(Properties<String^, Object^>^ credentials)
       {        
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -267,12 +303,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2   
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
       }
 
 			bool Cache::GetPdxIgnoreUnreadFields()
 			{
-				_GF_MG_EXCEPTION_TRY2
+				try {
 
 					try
 					{
@@ -283,12 +325,18 @@ namespace Apache
 					  GC::KeepAlive(m_nativeptr);
 					}
 
-				_GF_MG_EXCEPTION_CATCH_ALL2   
+				}
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
 			}
 
       bool Cache::GetPdxReadSerialized()
 			{
-				_GF_MG_EXCEPTION_TRY2
+				try {
 
 					try
 					{
@@ -299,13 +347,19 @@ namespace Apache
 					  GC::KeepAlive(m_nativeptr);
 					}
 
-				_GF_MG_EXCEPTION_CATCH_ALL2   
+				}
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
 			}
 
       IRegionService^ Cache::CreateAuthenticatedView(Properties<String^, Object^>^ credentials, String^ poolName)
       {
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -316,7 +370,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2   
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }   
       }
 
 			 void Cache::InitializeDeclarativeCache( String^ cacheXml )
diff --git a/clicache/src/CacheFactory.cpp b/clicache/src/CacheFactory.cpp
index 781cd57..5bbd7ce 100644
--- a/clicache/src/CacheFactory.cpp
+++ b/clicache/src/CacheFactory.cpp
@@ -59,7 +59,7 @@ namespace Apache
         native::createAppDomainContext = &Apache::Geode::Client::createAppDomainContext;
 				bool pdxIgnoreUnreadFields = false;
         bool pdxReadSerialized = false;
-        _GF_MG_EXCEPTION_TRY2
+        try {
           //msclr::lock lockInstance(m_singletonSync);
           auto nativeCache = std::make_shared<native::Cache>(m_nativeptr->get()->create( ));
 
@@ -80,7 +80,13 @@ namespace Apache
           cacheImpl->getSerializationRegistry()->setDataSerializableHandler(new ManagedDataSerializableHandler());
 
           return cache;
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         finally {
           GC::KeepAlive(m_nativeptr);
         }
@@ -100,7 +106,7 @@ namespace Apache
 
 			CacheFactory^ CacheFactory::SetPdxIgnoreUnreadFields(bool ignore)
 			{
-				_GF_MG_EXCEPTION_TRY2
+				try {
 
           try
           {
@@ -112,12 +118,18 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
 			}
 
       CacheFactory^ CacheFactory::SetPdxReadSerialized(bool pdxReadSerialized)
       {
-        	_GF_MG_EXCEPTION_TRY2
+        	try {
 
           try
           {
@@ -129,12 +141,18 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       CacheFactory^ CacheFactory::Set(String^ name, String^ value)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           try
           {
             m_nativeptr->get()->set(marshal_as<std::string>(name), to_utf8(value));
@@ -145,12 +163,18 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       CacheFactory^ CacheFactory::SetAuthInitialize(IAuthInitialize^ authInitialize)
       {
-        	_GF_MG_EXCEPTION_TRY2
+        	try {
 
           try
           {
@@ -167,7 +191,13 @@ namespace Apache
           }
           return this;
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
     }  // namespace Client
diff --git a/clicache/src/CacheTransactionManager.cpp b/clicache/src/CacheTransactionManager.cpp
index f5b39ed..60ef9ac 100644
--- a/clicache/src/CacheTransactionManager.cpp
+++ b/clicache/src/CacheTransactionManager.cpp
@@ -33,111 +33,183 @@ namespace Apache
 
       void CacheTransactionManager::Begin( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           m_nativeptr->begin( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void CacheTransactionManager::Prepare( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           m_nativeptr->prepare( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void CacheTransactionManager::Commit( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
             m_nativeptr->commit( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void CacheTransactionManager::Rollback( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
             m_nativeptr->rollback( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       bool CacheTransactionManager::Exists( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         return m_nativeptr->exists( );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       Apache::Geode::Client::TransactionId^ CacheTransactionManager::Suspend( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
        
           return Apache::Geode::Client::TransactionId::Create(&m_nativeptr->suspend());
        
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 			Apache::Geode::Client::TransactionId^ CacheTransactionManager::TransactionId::get( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return Apache::Geode::Client::TransactionId::Create(&m_nativeptr->getTransactionId());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       void CacheTransactionManager::Resume(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->resume(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::IsSuspended(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->isSuspended(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::TryResume(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->tryResume(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::TryResume(Apache::Geode::Client::TransactionId^ transactionId, TimeSpan waitTime)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->tryResume(transactionId->GetNative(), TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(waitTime));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       bool CacheTransactionManager::Exists(Apache::Geode::Client::TransactionId^ transactionId)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return m_nativeptr->exists(transactionId->GetNative());
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
 #ifdef CSTX_COMMENTED
       generic<class TKey, class TValue>
       ITransactionWriter<TKey, TValue>^ CacheTransactionManager::GetWriter( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           // Conver the unmanaged object to  managed generic object 
           std::shared_ptr<apache::geode::client::TransactionWriter>& writerPtr( m_nativeptr->getWriter( ) );
@@ -149,7 +221,13 @@ namespace Apache
             return (ITransactionWriter<TKey, TValue>^)twg->userptr( );
           }
         
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         
         return nullptr;
       }
@@ -157,7 +235,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void CacheTransactionManager::SetWriter(ITransactionWriter<TKey, TValue>^ transactionWriter)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           // Create a unmanaged object using the ManagedTransactionWriterGeneric.
           // Set the generic object inside the TransactionWriterGeneric that is a non generic object
           std::shared_ptr<apache::geode::client::TransactionWriter> writerPtr;
@@ -170,13 +248,19 @@ namespace Apache
           }
           m_nativeptr->setWriter( writerPtr );
           
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TKey, class TValue>
       void CacheTransactionManager::AddListener(ITransactionListener<TKey, TValue>^ transactionListener)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           // Create a unmanaged object using the ManagedTransactionListenerGeneric.
           // Set the generic object inside the TransactionListenerGeneric that is a non generic object
           std::shared_ptr<apache::geode::client::TransactionListener> listenerPtr;
@@ -189,13 +273,19 @@ namespace Apache
           }
           m_nativeptr->addListener( listenerPtr );
           
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
         
       generic<class TKey, class TValue>
       void CacheTransactionManager::RemoveListener(ITransactionListener<TKey, TValue>^ transactionListener)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           // Create an unmanaged non generic object using the managed generic object
           // use this to call the remove listener
           std::shared_ptr<apache::geode::client::TransactionListener> listenerPtr;
@@ -208,7 +298,13 @@ namespace Apache
           }
           m_nativeptr->removeListener( listenerPtr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 #endif
     }  // namespace Client
diff --git a/clicache/src/CacheableHashSet.hpp b/clicache/src/CacheableHashSet.hpp
index eb6410c..31a9a8a 100644
--- a/clicache/src/CacheableHashSet.hpp
+++ b/clicache/src/CacheableHashSet.hpp
@@ -370,7 +370,7 @@ namespace Apache
           /// </param>
           virtual void Add(Object^ item)
           {
-            _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+            try {/* due to auto replace */
 
             try
             {
@@ -381,7 +381,13 @@ namespace Apache
               GC::KeepAlive(m_nativeptr);
             }
 
-            _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+            }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           }
 
           /// <summary>
diff --git a/clicache/src/CqQuery.cpp b/clicache/src/CqQuery.cpp
index 543ee67..241945d 100644
--- a/clicache/src/CqQuery.cpp
+++ b/clicache/src/CqQuery.cpp
@@ -49,7 +49,7 @@ namespace Apache
       generic<class TKey, class TResult>
       ICqResults<TResult>^ CqQuery<TKey, TResult>::ExecuteWithInitialResults(TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             auto nativeptr = m_nativeptr->get()->executeWithInitialResults(TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(timeout));
@@ -65,13 +65,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       void CqQuery<TKey, TResult>::Execute()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -82,7 +88,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
@@ -180,7 +192,7 @@ namespace Apache
       generic<class TKey, class TResult>
       void CqQuery<TKey, TResult>::Stop( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -191,13 +203,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       void CqQuery<TKey, TResult>::Close( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -208,13 +226,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       bool CqQuery<TKey, TResult>::IsRunning( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -225,13 +249,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
       bool CqQuery<TKey, TResult>::IsStopped( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -242,13 +272,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TResult>
         bool CqQuery<TKey, TResult>::IsClosed()
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             try
           {
@@ -259,7 +295,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/DataInput.cpp b/clicache/src/DataInput.cpp
index e307293..e22193b 100644
--- a/clicache/src/DataInput.cpp
+++ b/clicache/src/DataInput.cpp
@@ -59,7 +59,7 @@ namespace Apache
         m_isRootObjectPdx = false;
         m_cache = cache;
         if (buffer != nullptr && size > 0) {
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
           m_nativeptr = gcnew native_conditional_unique_ptr<native::DataInput>(
             std::make_unique<native::DataInput>(cache->GetNative()->createDataInput(buffer, size)));
@@ -77,7 +77,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
         else {
           throw gcnew IllegalArgumentException("DataInput.ctor(): "
@@ -91,7 +97,7 @@ namespace Apache
         m_isRootObjectPdx = false;
         m_cache =  cache;
         if (buffer != nullptr && buffer->Length > 0) {
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
           auto len = buffer->Length;
           m_ownedBuffer = make_native_unique<System::Byte[]>(len);
@@ -114,7 +120,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
         else {
           throw gcnew IllegalArgumentException("DataInput.ctor(): "
@@ -133,7 +145,7 @@ namespace Apache
               "DataInput.ctor(): given length {0} is zero or greater than "
               "size of buffer {1}", len, buffer->Length));
           }
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
           m_ownedBuffer = make_native_unique<System::Byte[]>(len);
           m_buffer = m_ownedBuffer->get();
@@ -152,7 +164,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
         else {
           throw gcnew IllegalArgumentException("DataInput.ctor(): "
diff --git a/clicache/src/DistributedSystem.cpp b/clicache/src/DistributedSystem.cpp
index 57bfb2d..db3454d 100644
--- a/clicache/src/DistributedSystem.cpp
+++ b/clicache/src/DistributedSystem.cpp
@@ -133,7 +133,7 @@ namespace Apache
       DistributedSystem^ DistributedSystem::Connect(String^ name, Properties<String^, String^>^ config, Cache ^ cache)
       {
         // TODO AppDomain should we be able to create a DS directly?
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         auto nativeDistributedSystem = native::DistributedSystem::create(to_utf8(name),
                                                            config->GetNative());
@@ -144,16 +144,28 @@ namespace Apache
         return gcnew DistributedSystem(std::unique_ptr<native::DistributedSystem>(
             new native::DistributedSystem(std::move(nativeDistributedSystem))));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void DistributedSystem::Disconnect(Cache^ cache)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
           DistributedSystem::UnregisterBuiltinManagedTypes(cache);
           m_nativeDistributedSystem->get()->disconnect();
           GC::KeepAlive(m_nativeDistributedSystem);
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void DistributedSystem::RegisterDataSerializablePrimitives(Cache^ cache)
@@ -313,7 +325,7 @@ namespace Apache
             gcnew TypeFactoryMethod(Apache::Geode::Client::Internal::PdxType::CreateDeserializable),
             nullptr);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           // Set the Generic ManagedCacheLoader/Listener/Writer factory functions.
           native::CacheXmlParser::managedCacheLoaderFn_ =
@@ -331,7 +343,13 @@ namespace Apache
           native::CacheXmlParser::managedPersistenceManagerFn_ =
             native::ManagedPersistenceManagerGeneric::create;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void DistributedSystem::ManagedPostConnect(Cache^ cache)
@@ -349,7 +367,7 @@ namespace Apache
 
       void DistributedSystem::UnregisterBuiltinManagedTypes(Cache^ cache)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           TypeRegistry::UnregisterNativesGeneric(cache);
 
@@ -376,17 +394,29 @@ namespace Apache
           cache->TypeRegistry->UnregisterTypeGeneric(
             static_cast<int8_t>(native::internal::InternalId::CacheableManagedObjectXml));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       Apache::Geode::Client::SystemProperties^ DistributedSystem::SystemProperties::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           return Apache::Geode::Client::SystemProperties::Create(
           &(m_nativeDistributedSystem->get()->getSystemProperties()));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       String^ DistributedSystem::Name::get()
diff --git a/clicache/src/ExceptionTypes.cpp b/clicache/src/ExceptionTypes.cpp
index db10029..82bcc7b 100644
--- a/clicache/src/ExceptionTypes.cpp
+++ b/clicache/src/ExceptionTypes.cpp
@@ -20,8 +20,7 @@
 #include "ExceptionTypes.hpp"
 #include <cstdlib>
 
-#define _GF_MG_EXCEPTION_ADD3(x) { "apache::geode::client::" #x, gcnew CreateException2( x::Create ) }
-#define _GF_MG_EXCEPTION_ADD4(x,y) { "apache::geode::client::" #y, gcnew CreateException2( x::Create ) }
+//#define _GF_MG_EXCEPTION_ADD4(x,y) { "apache::geode::client::" #y, gcnew CreateException2( x::Create ) }
 
 using namespace System;
 
@@ -40,67 +39,67 @@ namespace Apache
           return Native2ManagedExMap;
         }
         array<NameDelegatePair>^ exNamesDelegates = gcnew array<NameDelegatePair> {
-          _GF_MG_EXCEPTION_ADD3( AssertionException ),
-          _GF_MG_EXCEPTION_ADD3( IllegalArgumentException ),
-          _GF_MG_EXCEPTION_ADD3( IllegalStateException ),
-          _GF_MG_EXCEPTION_ADD3( CacheExistsException ),
-          _GF_MG_EXCEPTION_ADD3( CacheXmlException ),
-          _GF_MG_EXCEPTION_ADD3( TimeoutException ),
-          _GF_MG_EXCEPTION_ADD3( CacheWriterException ),
-          _GF_MG_EXCEPTION_ADD3( CacheListenerException ),
-          _GF_MG_EXCEPTION_ADD3( RegionExistsException ),
-          _GF_MG_EXCEPTION_ADD3( CacheClosedException ),
-          _GF_MG_EXCEPTION_ADD3( LeaseExpiredException ),
-          _GF_MG_EXCEPTION_ADD3( CacheLoaderException ),
-          _GF_MG_EXCEPTION_ADD3( RegionDestroyedException ),
-          _GF_MG_EXCEPTION_ADD3( EntryDestroyedException ),
-          _GF_MG_EXCEPTION_ADD3( NoSystemException ),
-          _GF_MG_EXCEPTION_ADD3( AlreadyConnectedException ),
-          _GF_MG_EXCEPTION_ADD3( FileNotFoundException ),          
-          _GF_MG_EXCEPTION_ADD3( InterruptedException ),
-          _GF_MG_EXCEPTION_ADD3( UnsupportedOperationException ),
-          _GF_MG_EXCEPTION_ADD3( StatisticsDisabledException ),
-          _GF_MG_EXCEPTION_ADD3( ConcurrentModificationException ),
-          _GF_MG_EXCEPTION_ADD3( UnknownException ),
-          _GF_MG_EXCEPTION_ADD3( ClassCastException ),
-          _GF_MG_EXCEPTION_ADD3( EntryNotFoundException ),
-          _GF_MG_EXCEPTION_ADD4( GeodeIOException, GeodeIOException ),
-          _GF_MG_EXCEPTION_ADD4( GeodeConfigException, GeodeConfigException ),
-          _GF_MG_EXCEPTION_ADD3( NullPointerException ),
-          _GF_MG_EXCEPTION_ADD3( EntryExistsException ),
-          _GF_MG_EXCEPTION_ADD3( NotConnectedException ),
-          _GF_MG_EXCEPTION_ADD3( CacheProxyException ),
-          _GF_MG_EXCEPTION_ADD3( OutOfMemoryException ),
-          _GF_MG_EXCEPTION_ADD3( NotOwnerException ),
-          _GF_MG_EXCEPTION_ADD3( WrongRegionScopeException ),
-          _GF_MG_EXCEPTION_ADD3( BufferSizeExceededException ),
-          _GF_MG_EXCEPTION_ADD3( RegionCreationFailedException ),
-          _GF_MG_EXCEPTION_ADD3( FatalInternalException ),
-          _GF_MG_EXCEPTION_ADD3( DiskFailureException ),
-          _GF_MG_EXCEPTION_ADD3( DiskCorruptException ),
-          _GF_MG_EXCEPTION_ADD3( InitFailedException ),
-          _GF_MG_EXCEPTION_ADD3( ShutdownFailedException ),
-          _GF_MG_EXCEPTION_ADD3( CacheServerException ),
-          _GF_MG_EXCEPTION_ADD3( OutOfRangeException ),
-          _GF_MG_EXCEPTION_ADD3( QueryException ),
-          _GF_MG_EXCEPTION_ADD3( MessageException ),
-          _GF_MG_EXCEPTION_ADD3( NotAuthorizedException ),
-          _GF_MG_EXCEPTION_ADD3( AuthenticationFailedException ),
-          _GF_MG_EXCEPTION_ADD3( AuthenticationRequiredException ),
-          _GF_MG_EXCEPTION_ADD3( DuplicateDurableClientException ),
-          _GF_MG_EXCEPTION_ADD3( NoAvailableLocatorsException ),
-          _GF_MG_EXCEPTION_ADD3( FunctionExecutionException ),
-          _GF_MG_EXCEPTION_ADD3( CqInvalidException ),
-          _GF_MG_EXCEPTION_ADD3( CqExistsException ),
-          _GF_MG_EXCEPTION_ADD3( CqQueryException ),
-          _GF_MG_EXCEPTION_ADD3( CqClosedException ),
-          _GF_MG_EXCEPTION_ADD3( CqException ),
-          _GF_MG_EXCEPTION_ADD3( AllConnectionsInUseException ),
-          _GF_MG_EXCEPTION_ADD3( InvalidDeltaException ),
-          _GF_MG_EXCEPTION_ADD3( KeyNotFoundException ),
-          _GF_MG_EXCEPTION_ADD3( CommitConflictException ),
-          _GF_MG_EXCEPTION_ADD3( TransactionDataNodeHasDepartedException ),
-          _GF_MG_EXCEPTION_ADD3( TransactionDataRebalancedException )
+          { "apache::geode::client::" "AssertionException", gcnew CreateException2( AssertionException::Create ) },
+          { "apache::geode::client::" "IllegalArgumentException", gcnew CreateException2( IllegalArgumentException::Create ) },
+          { "apache::geode::client::" "IllegalStateException", gcnew CreateException2( IllegalStateException::Create ) },
+          { "apache::geode::client::" "CacheExistsException", gcnew CreateException2( CacheExistsException::Create ) },
+          { "apache::geode::client::" "CacheXmlException", gcnew CreateException2( CacheXmlException::Create ) },
+          { "apache::geode::client::" "TimeoutException", gcnew CreateException2( TimeoutException::Create ) },
+          { "apache::geode::client::" "CacheWriterException", gcnew CreateException2( CacheWriterException::Create ) },
+          { "apache::geode::client::" "CacheListenerException", gcnew CreateException2( CacheListenerException::Create ) },
+          { "apache::geode::client::" "RegionExistsException", gcnew CreateException2( RegionExistsException::Create ) },
+          { "apache::geode::client::" "CacheClosedException", gcnew CreateException2( CacheClosedException::Create ) },
+          { "apache::geode::client::" "LeaseExpiredException", gcnew CreateException2( LeaseExpiredException::Create ) },
+          { "apache::geode::client::" "CacheLoaderException", gcnew CreateException2( CacheLoaderException::Create ) },
+          { "apache::geode::client::" "RegionDestroyedException", gcnew CreateException2( RegionDestroyedException::Create ) },
+          { "apache::geode::client::" "EntryDestroyedException", gcnew CreateException2( EntryDestroyedException::Create ) },
+          { "apache::geode::client::" "NoSystemException", gcnew CreateException2( NoSystemException::Create ) },
+          { "apache::geode::client::" "AlreadyConnectedException", gcnew CreateException2( AlreadyConnectedException::Create ) },
+          { "apache::geode::client::" "FileNotFoundException", gcnew CreateException2( FileNotFoundException::Create ) },          
+          { "apache::geode::client::" "InterruptedException", gcnew CreateException2( InterruptedException::Create ) },
+          { "apache::geode::client::" "UnsupportedOperationException", gcnew CreateException2( UnsupportedOperationException::Create ) },
+          { "apache::geode::client::" "StatisticsDisabledException", gcnew CreateException2( StatisticsDisabledException::Create ) },
+          { "apache::geode::client::" "ConcurrentModificationException", gcnew CreateException2( ConcurrentModificationException::Create ) },
+          { "apache::geode::client::" "UnknownException", gcnew CreateException2( UnknownException::Create ) },
+          { "apache::geode::client::" "ClassCastException", gcnew CreateException2( ClassCastException::Create ) },
+          { "apache::geode::client::" "EntryNotFoundException", gcnew CreateException2( EntryNotFoundException::Create ) },
+          { "apache::geode::client::" "GeodeIOException", gcnew CreateException2( GeodeIOException::Create ) },
+          { "apache::geode::client::" "GeodeConfigException", gcnew CreateException2( GeodeConfigException::Create ) },
+          { "apache::geode::client::" "NullPointerException", gcnew CreateException2( NullPointerException::Create ) },
+          { "apache::geode::client::" "EntryExistsException", gcnew CreateException2( EntryExistsException::Create ) },
+          { "apache::geode::client::" "NotConnectedException", gcnew CreateException2( NotConnectedException::Create ) },
+          { "apache::geode::client::" "CacheProxyException", gcnew CreateException2( CacheProxyException::Create ) },
+          { "apache::geode::client::" "OutOfMemoryException", gcnew CreateException2( OutOfMemoryException::Create ) },
+          { "apache::geode::client::" "NotOwnerException", gcnew CreateException2( NotOwnerException::Create ) },
+          { "apache::geode::client::" "WrongRegionScopeException", gcnew CreateException2( WrongRegionScopeException::Create ) },
+          { "apache::geode::client::" "BufferSizeExceededException", gcnew CreateException2( BufferSizeExceededException::Create ) },
+          { "apache::geode::client::" "RegionCreationFailedException", gcnew CreateException2( RegionCreationFailedException::Create ) },
+          { "apache::geode::client::" "FatalInternalException", gcnew CreateException2( FatalInternalException::Create ) },
+          { "apache::geode::client::" "DiskFailureException", gcnew CreateException2( DiskFailureException::Create ) },
+          { "apache::geode::client::" "DiskCorruptException", gcnew CreateException2( DiskCorruptException::Create ) },
+          { "apache::geode::client::" "InitFailedException", gcnew CreateException2( InitFailedException::Create ) },
+          { "apache::geode::client::" "ShutdownFailedException", gcnew CreateException2( ShutdownFailedException::Create ) },
+          { "apache::geode::client::" "CacheServerException", gcnew CreateException2( CacheServerException::Create ) },
+          { "apache::geode::client::" "OutOfRangeException", gcnew CreateException2( OutOfRangeException::Create ) },
+          { "apache::geode::client::" "QueryException", gcnew CreateException2( QueryException::Create ) },
+          { "apache::geode::client::" "MessageException", gcnew CreateException2( MessageException::Create ) },
+          { "apache::geode::client::" "NotAuthorizedException", gcnew CreateException2( NotAuthorizedException::Create ) },
+          { "apache::geode::client::" "AuthenticationFailedException", gcnew CreateException2( AuthenticationFailedException::Create ) },
+          { "apache::geode::client::" "AuthenticationRequiredException", gcnew CreateException2( AuthenticationRequiredException::Create ) },
+          { "apache::geode::client::" "DuplicateDurableClientException", gcnew CreateException2( DuplicateDurableClientException::Create ) },
+          { "apache::geode::client::" "NoAvailableLocatorsException", gcnew CreateException2( NoAvailableLocatorsException::Create ) },
+          { "apache::geode::client::" "FunctionExecutionException", gcnew CreateException2( FunctionExecutionException::Create ) },
+          { "apache::geode::client::" "CqInvalidException", gcnew CreateException2( CqInvalidException::Create ) },
+          { "apache::geode::client::" "CqExistsException", gcnew CreateException2( CqExistsException::Create ) },
+          { "apache::geode::client::" "CqQueryException", gcnew CreateException2( CqQueryException::Create ) },
+          { "apache::geode::client::" "CqClosedException", gcnew CreateException2( CqClosedException::Create ) },
+          { "apache::geode::client::" "CqException", gcnew CreateException2( CqException::Create ) },
+          { "apache::geode::client::" "AllConnectionsInUseException", gcnew CreateException2( AllConnectionsInUseException::Create ) },
+          { "apache::geode::client::" "InvalidDeltaException", gcnew CreateException2( InvalidDeltaException::Create ) },
+          { "apache::geode::client::" "KeyNotFoundException", gcnew CreateException2( KeyNotFoundException::Create ) },
+          { "apache::geode::client::" "CommitConflictException", gcnew CreateException2( CommitConflictException::Create ) },
+          { "apache::geode::client::" "TransactionDataNodeHasDepartedException", gcnew CreateException2( TransactionDataNodeHasDepartedException::Create ) },
+          { "apache::geode::client::" "TransactionDataRebalancedException", gcnew CreateException2( TransactionDataRebalancedException::Create ) }
         };
 
         Native2ManagedExMap = gcnew Dictionary<String^, CreateException2^>( );
diff --git a/clicache/src/ExceptionTypes.hpp b/clicache/src/ExceptionTypes.hpp
index fb31b20..00a9716 100644
--- a/clicache/src/ExceptionTypes.hpp
+++ b/clicache/src/ExceptionTypes.hpp
@@ -266,20 +266,6 @@ namespace Apache
           : Exception( info, context ) { }
       };
 
-/// Handle geode exceptions from native layer and convert to managed
-/// exceptions.
-#define _GF_MG_EXCEPTION_TRY2        \
-      try {
-#define _GF_MG_EXCEPTION_CATCH_ALL2  \
-      } \
-      catch (const apache::geode::client::Exception& ex) { \
-      throw Apache::Geode::Client::GeodeException::Get(ex); \
-      } \
-      catch (System::AccessViolationException^ ex) { \
-        throw ex; \
-      }
-
-
 /// Creates a class <c>x</c> named for each exception <c>y</c>.
 #define _GF_MG_EXCEPTION_DEF4(x,y) \
       [Serializable] \
diff --git a/clicache/src/Execution.cpp b/clicache/src/Execution.cpp
index b56a24e..b30ccc3 100644
--- a/clicache/src/Execution.cpp
+++ b/clicache/src/Execution.cpp
@@ -42,7 +42,7 @@ namespace Apache
       Execution<TResult>^ Execution<TResult>::WithFilter(System::Collections::Generic::ICollection<TFilter>^ routingObj)
       {
         if (routingObj != nullptr) {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           auto rsptr = native::CacheableVector::create();
         
           for each(TFilter item in routingObj)
@@ -59,7 +59,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
         else {
           throw gcnew IllegalArgumentException("Execution<TResult>::WithFilter: null TFilter provided");
@@ -70,7 +76,7 @@ namespace Apache
       generic<class TArgs>
       Execution<TResult>^ Execution<TResult>::WithArgs( TArgs args )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             auto argsptr = Serializable::GetUnmanagedValueGeneric<TArgs>( args );
@@ -80,13 +86,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       Execution<TResult>^ Execution<TResult>::WithCollector(Client::IResultCollector<TResult>^ rc)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           std::shared_ptr<native::ResultCollector> rcptr;
         if ( rc != nullptr ) {
           auto rcg = gcnew ResultCollectorGeneric<TResult>();
@@ -101,12 +113,18 @@ namespace Apache
         {
           GC::KeepAlive(m_nativeptr);
         }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
       generic<class TResult>
       IResultCollector<TResult>^ Execution<TResult>::Execute(String^ func, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
         try
         {
           auto rc = m_nativeptr->get()->execute(to_utf8(func), TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(timeout));
@@ -119,7 +137,13 @@ namespace Apache
         {
           GC::KeepAlive(m_nativeptr);
         }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
diff --git a/clicache/src/FunctionService.cpp b/clicache/src/FunctionService.cpp
index 4540970..785b99e 100644
--- a/clicache/src/FunctionService.cpp
+++ b/clicache/src/FunctionService.cpp
@@ -41,41 +41,59 @@ namespace Apache
       generic <class TKey, class TValue>
       Execution<TResult>^ FunctionService<TResult>::OnRegion( IRegion<TKey, TValue>^ rg )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           
           auto nativeRegion = ((Region<TKey, TValue>^)rg)->GetNative();
           auto execution = native::FunctionService::onRegion(nativeRegion);
           return Execution<TResult>::Create( std::move(execution), nullptr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic <class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServer( Pool^ pl )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           auto nativeptr = native::FunctionService::onServer(pl->GetNative());
           return Execution<TResult>::Create(std::move(nativeptr) , nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
       
       generic <class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServers( Pool^ pl )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           auto nativeptr = native::FunctionService::onServers(pl->GetNative());
           return Execution<TResult>::Create(std::move(nativeptr) , nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServer( IRegionService^ cache )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           if(auto realCache = dynamic_cast<Cache^>(cache))
           {
@@ -89,13 +107,19 @@ namespace Apache
             return Execution<TResult>::Create(std::move(nativeptr), nullptr );
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       Execution<TResult>^ FunctionService<TResult>::OnServers( IRegionService^ cache )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           if(auto realCache = dynamic_cast<Cache^>(cache))
           {
@@ -109,7 +133,13 @@ namespace Apache
             return Execution<TResult>::Create(std::move(nativeptr), nullptr );
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/LocalRegion.cpp b/clicache/src/LocalRegion.cpp
index 6a81cb4..a904f70 100644
--- a/clicache/src/LocalRegion.cpp
+++ b/clicache/src/LocalRegion.cpp
@@ -64,7 +64,7 @@ namespace Apache
       generic<class TKey, class TValue>
       std::shared_ptr<apache::geode::client::Serializable> LocalRegion<TKey, TValue>::getRegionEntryValue(std::shared_ptr<apache::geode::client::CacheableKey>& keyptr)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             if (auto entryPtr = m_nativeptr->get()->getEntry(keyptr)) {
@@ -78,13 +78,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Put(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -98,7 +104,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -123,7 +135,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::default::set(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -136,7 +148,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -145,7 +163,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -156,7 +174,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         auto toArray = gcnew array<KeyValuePair<TKey,TValue>>(static_cast<int>(vc.size()));
         for( System::Int32 index = 0; index < vc.size( ); index++ )
@@ -175,7 +199,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -186,7 +210,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         auto toArray = gcnew array<Object^>(static_cast<int>(vc.size()));
         for( System::Int32 index = 0; index < vc.size( ); index++ )
@@ -215,7 +245,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::ContainsKey(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -227,7 +257,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -248,7 +284,7 @@ namespace Apache
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TKey>^ LocalRegion<TKey, TValue>::Keys::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<apache::geode::client::CacheableKey>> vc;
         try
@@ -269,13 +305,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TKey>^)keyarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TValue>^ LocalRegion<TKey, TValue>::Values::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           std::vector<std::shared_ptr<apache::geode::client::Cacheable>> vc;
           try
@@ -297,13 +339,19 @@ namespace Apache
           auto collectionlist = (System::Collections::Generic::ICollection<TValue>^)valarr;
           return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Add(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -316,13 +364,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Add(KeyValuePair<TKey, TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -335,13 +389,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-       _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+       }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Add(TKey key, TValue value, Object^ callbackArg)
       {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
           try
           {
@@ -355,13 +415,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -378,14 +444,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove( TKey key, Object^ callbackArg )
       {
-         _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+         try {/* due to auto replace */
            try
            {
              std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
@@ -401,13 +473,19 @@ namespace Apache
            {
              GC::KeepAlive(m_nativeptr);
            }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove(KeyValuePair<TKey,TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -420,13 +498,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::Remove(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -440,23 +524,35 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::InvalidateRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           InvalidateRegion( nullptr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::InvalidateRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -468,23 +564,35 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::DestroyRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           DestroyRegion( nullptr );
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::DestroyRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
@@ -494,24 +602,36 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Invalidate(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
          Invalidate(key, nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Invalidate(TKey key, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -524,7 +644,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -613,7 +739,7 @@ namespace Apache
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ LocalRegion<TKey, TValue>::ParentRegion::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -628,13 +754,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::RegionAttributes<TKey, TValue>^ LocalRegion<TKey, TValue>::Attributes::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -645,13 +777,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       AttributesMutator<TKey, TValue>^ LocalRegion<TKey, TValue>::AttributesMutator::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -662,13 +800,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::CacheStatistics^ LocalRegion<TKey, TValue>::Statistics::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -679,13 +823,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ LocalRegion<TKey, TValue>::GetSubRegion( String^ path )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -701,14 +851,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ LocalRegion<TKey, TValue>::CreateSubRegion( String^ subRegionName,
         Apache::Geode::Client::RegionAttributes<TKey, TValue>^ attributes)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -721,14 +877,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^ LocalRegion<TKey, TValue>::SubRegions( bool recursive )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           std::vector<std::shared_ptr<apache::geode::client::Region>> vsr;
           try
@@ -750,13 +912,19 @@ namespace Apache
           auto collection = (System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^)subRegions;
           return collection;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       RegionEntry<TKey, TValue>^ LocalRegion<TKey, TValue>::GetEntry( TKey key )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -769,13 +937,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<RegionEntry<TKey, TValue>^>^ LocalRegion<TKey, TValue>::GetEntries(bool recursive)
       {
-         _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+         try {/* due to auto replace */
 
           std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
           try
@@ -796,7 +970,13 @@ namespace Apache
           auto collection = (System::Collections::Generic::ICollection<RegionEntry<TKey, TValue>^>^)entryarr;
           return collection;
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -809,7 +989,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool LocalRegion<TKey, TValue>::ContainsValueForKey( TKey key )
       {
-         _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+         try {/* due to auto replace */
 
            try
            {
@@ -821,7 +1001,13 @@ namespace Apache
              GC::KeepAlive(m_nativeptr);
            }
 
-         _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+         }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -846,7 +1032,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void LocalRegion<TKey, TValue>::Clear(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             m_nativeptr->get()->localClear(Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg ) );
@@ -855,7 +1041,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
 
@@ -872,7 +1064,7 @@ namespace Apache
           throw gcnew System::ArgumentOutOfRangeException;
         }
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
         try
@@ -898,7 +1090,13 @@ namespace Apache
           ++startIdx;
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
diff --git a/clicache/src/Log.cpp b/clicache/src/Log.cpp
index 4264fd4..2b8cbec 100644
--- a/clicache/src/Log.cpp
+++ b/clicache/src/Log.cpp
@@ -34,24 +34,36 @@ namespace Apache
 
       void Log::Init(LogLevel level, String^ logFileName)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           ManagedString mg_lfname(logFileName);
         apache::geode::client::Log::init(static_cast<apache::geode::client::LogLevel>(level),
                                          mg_lfname.CharPtr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void Log::Init(LogLevel level, String^ logFileName, System::Int32 logFileLimit)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           ManagedString mg_lfname(logFileName);
         apache::geode::client::Log::init(static_cast<apache::geode::client::LogLevel>(level),
                                          mg_lfname.CharPtr, logFileLimit);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void Log::Close()
@@ -78,13 +90,19 @@ namespace Apache
 
       void Log::Write(LogLevel level, String^ msg)
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           ManagedString mg_msg(msg);
         apache::geode::client::Log::log(static_cast<apache::geode::client::LogLevel>(level),
                                         mg_msg.CharPtr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void Log::LogThrow(LogLevel level, String^ msg, System::Exception^ ex)
diff --git a/clicache/src/Pool.cpp b/clicache/src/Pool.cpp
index 2a30503..f269e96 100644
--- a/clicache/src/Pool.cpp
+++ b/clicache/src/Pool.cpp
@@ -451,7 +451,7 @@ namespace Apache
 
       QueryService^ Pool::GetQueryService()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -463,12 +463,18 @@ namespace Apache
           }
 
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
       
       Int32 Pool::PendingEventCount::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -480,7 +486,13 @@ namespace Apache
           }
 
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/PoolFactory.cpp b/clicache/src/PoolFactory.cpp
index 9c62562..15e7f30 100644
--- a/clicache/src/PoolFactory.cpp
+++ b/clicache/src/PoolFactory.cpp
@@ -37,7 +37,7 @@ namespace Apache
 
       PoolFactory^ PoolFactory::SetFreeConnectionTimeout( TimeSpan connectionTimeout )
 		  {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -48,14 +48,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetLoadConditioningInterval( TimeSpan loadConditioningInterval )
 		  {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -66,14 +72,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetSocketBufferSize( Int32 bufferSize )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -84,14 +96,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetReadTimeout( TimeSpan timeout )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -102,14 +120,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetMinConnections( Int32 minConnections )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -120,14 +144,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetMaxConnections( Int32 maxConnections )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -138,14 +168,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetIdleTimeout( TimeSpan idleTimeout )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -156,14 +192,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetRetryAttempts( Int32 retryAttempts )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -174,14 +216,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetPingInterval( TimeSpan pingInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -192,14 +240,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetUpdateLocatorListInterval( TimeSpan updateLocatorListInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -210,14 +264,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
       PoolFactory^ PoolFactory::SetStatisticInterval( TimeSpan statisticInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -228,13 +288,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
       PoolFactory^ PoolFactory::SetServerGroup( String^ group )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -245,14 +311,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::AddLocator( String^ host, Int32 port )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -263,14 +335,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
       PoolFactory^ PoolFactory::AddServer( String^ host, Int32 port )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -281,13 +359,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 		  PoolFactory^ PoolFactory::SetSniProxy(String^ hostname, Int32 port)
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -298,13 +382,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 		  PoolFactory^ PoolFactory::SetSubscriptionEnabled( Boolean enabled )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -315,14 +405,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
           PoolFactory^ PoolFactory::SetPRSingleHopEnabled( Boolean enabled )
           {
-            _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+            try {/* due to auto replace */
 
               try
               {
@@ -333,14 +429,20 @@ namespace Apache
                 GC::KeepAlive(m_nativeptr);
               }
 
-             _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+             }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
                return this;
           }
 
     
 		  PoolFactory^ PoolFactory::SetSubscriptionRedundancy( Int32 redundancy )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -351,14 +453,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetSubscriptionMessageTrackingTimeout( TimeSpan messageTrackingTimeout )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -369,14 +477,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
 		  PoolFactory^ PoolFactory::SetSubscriptionAckInterval( TimeSpan ackInterval )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -387,12 +501,18 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
       PoolFactory^ PoolFactory::SetThreadLocalConnections( Boolean enabled )
       {
-			  _GF_MG_EXCEPTION_TRY2
+			  try {
 
 			  try
 			  {
@@ -403,13 +523,19 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
           return this;
 	  }
 
       PoolFactory^ PoolFactory::SetMultiuserAuthentication( bool multiuserAuthentication )
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
           try
           {
@@ -420,14 +546,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 	   }
 
 
 		  PoolFactory^ PoolFactory::Reset()
       {
-			  _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+			  try {/* due to auto replace */
 
 			  try
 			  {
@@ -438,14 +570,20 @@ namespace Apache
 			    GC::KeepAlive(m_nativeptr);
 			  }
 
-			  _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+			  }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
           return this;
 		  }
 
 
       Pool^ PoolFactory::Create(String^ name)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -456,7 +594,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
         
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/Properties.cpp b/clicache/src/Properties.cpp
index dc37432..e359c29 100644
--- a/clicache/src/Properties.cpp
+++ b/clicache/src/Properties.cpp
@@ -86,7 +86,7 @@ namespace Apache
         std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key, true);
         std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TPropValue>(value, true);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -97,7 +97,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
@@ -105,7 +111,7 @@ namespace Apache
       {
         std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -116,7 +122,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
@@ -132,7 +144,7 @@ namespace Apache
           auto otherVisitor = gcnew PropertyVisitor(proxy, &PropertyVisitorProxy<TPropKey, TPropValue>::Visit);
           mg_visitor.setptr(otherVisitor);
 
-          _GF_MG_EXCEPTION_TRY2
+          try {
 
             try
             {
@@ -143,14 +155,20 @@ namespace Apache
               GC::KeepAlive(m_nativeptr);
             }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
         }
       }
 
       generic<class TPropKey, class TPropValue>
       System::UInt32 Properties<TPropKey, TPropValue>::Size::get( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -161,13 +179,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
       void Properties<TPropKey, TPropValue>::AddAll( Properties<TPropKey, TPropValue>^ other )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -178,13 +202,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
       void Properties<TPropKey, TPropValue>::Load( String^ fileName )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -195,7 +225,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
@@ -219,11 +255,17 @@ namespace Apache
           auto nativeOutput = output->GetNative();
           if (nativeOutput != nullptr)
           {
-            _GF_MG_EXCEPTION_TRY2
+            try {
 
                 m_nativeptr->get()->toData(*nativeOutput);
 
-            _GF_MG_EXCEPTION_CATCH_ALL2
+            }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
           }
 
           if (output->IsManagedObject()) {
@@ -258,7 +300,7 @@ namespace Apache
       generic<class TPropKey, class TPropValue>
       void Properties<TPropKey, TPropValue>::FromData( native::DataInput& input )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         try
         {
@@ -269,14 +311,20 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TPropKey, class TPropValue>
       System::UInt64 Properties<TPropKey, TPropValue>::ObjectSize::get( )
       {
         //TODO::
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -287,7 +335,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       // ISerializable methods
@@ -298,7 +352,7 @@ namespace Apache
       //{
       //  auto output = std::unique_ptr<native::DataOutput>(new native::DataOutput(*m_serializationRegistry->get_shared_ptr()));
 
-      //  _GF_MG_EXCEPTION_TRY2
+      //  try {
 
       //    try
       //    {
@@ -309,7 +363,13 @@ namespace Apache
       //      GC::KeepAlive(m_nativeptr);
       //    }
 
-      //  _GF_MG_EXCEPTION_CATCH_ALL2
+      //  }
+      //  catch (const apache::geode::client::Exception& ex) {
+      //    throw Apache::Geode::Client::GeodeException::Get(ex);
+      //  }
+      //  catch (System::AccessViolationException^ ex) {
+      //    throw ex;
+      //  }
 
       //  auto bytes = gcnew array<Byte>( output->getBufferLength( ) );
       //  {
@@ -336,11 +396,17 @@ namespace Apache
       //  if (bytes != nullptr) {
       //    pin_ptr<const Byte> pin_bytes = &bytes[0];
 
-      //    _GF_MG_EXCEPTION_TRY2
+      //    try {
 
       //      native::DataInput input( (System::Byte*)pin_bytes, bytes->Length, *CacheImpl::getInstance()->getSerializationRegistry().get());
       //      FromData(input);
-      //    _GF_MG_EXCEPTION_CATCH_ALL2
+      //    }
+      //    catch (const apache::geode::client::Exception& ex) {
+      //      throw Apache::Geode::Client::GeodeException::Get(ex);
+      //    }
+      //    catch (System::AccessViolationException^ ex) {
+      //      throw ex;
+      //    }
       //  }
       //}
 
diff --git a/clicache/src/Query.cpp b/clicache/src/Query.cpp
index 18393c4..001c125 100644
--- a/clicache/src/Query.cpp
+++ b/clicache/src/Query.cpp
@@ -47,7 +47,7 @@ namespace Apache
       generic<class TResult>
       ISelectResults<TResult>^ Query<TResult>::Execute( TimeSpan timeout )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -58,7 +58,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }        
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 	
       generic<class TResult>
@@ -70,7 +76,7 @@ namespace Apache
       generic<class TResult>
       ISelectResults<TResult>^ Query<TResult>::Execute( array<Object^>^ paramList, TimeSpan timeout )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           auto rsptr = apache::geode::client::CacheableVector::create();
           for( int index = 0; index < paramList->Length; index++ )
@@ -88,7 +94,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
@@ -124,7 +136,7 @@ namespace Apache
       generic<class TResult>
       void Query<TResult>::Compile( )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -135,13 +147,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       bool Query<TResult>::IsCompiled::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -152,7 +170,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/Region.cpp b/clicache/src/Region.cpp
index c98bf82..a29252e 100644
--- a/clicache/src/Region.cpp
+++ b/clicache/src/Region.cpp
@@ -79,7 +79,7 @@ namespace Apache
       generic<class TKey, class TValue>
       std::shared_ptr<native::Serializable> Region<TKey, TValue>::get(std::shared_ptr<native::CacheableKey>& keyptr, std::shared_ptr<native::Serializable>& callbackptr)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             return m_nativeptr->get()->get(keyptr, callbackptr);
@@ -88,13 +88,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       std::shared_ptr<native::Serializable> Region<TKey, TValue>::get(std::shared_ptr<native::CacheableKey>& keyptr)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             return m_nativeptr->get()->get(keyptr);
@@ -103,13 +109,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::isPoolInMultiuserMode()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           auto rAttributes = this->Attributes;
           auto poolName = rAttributes->PoolName;
           if (poolName != nullptr) {
@@ -120,13 +132,19 @@ namespace Apache
             }
           }
           return false;
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Put(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -140,7 +158,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -166,7 +190,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::default::set(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -179,7 +203,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -188,7 +218,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -199,7 +229,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
           auto toArray = gcnew array<KeyValuePair<TKey, TValue>>(static_cast<int>(vc.size()));
 
@@ -219,7 +255,7 @@ namespace Apache
       {
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -230,7 +266,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
          auto toArray = gcnew array<Object^>(static_cast<int>(vc.size()));
 
@@ -261,7 +303,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::ContainsKey(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -273,13 +315,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::TryGetValue(TKey key, TValue %val)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
         std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
         GC::KeepAlive(m_nativeptr);
         auto nativeptr = this->get(keyptr);
@@ -292,13 +340,19 @@ namespace Apache
           return true;
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TKey>^ Region<TKey, TValue>::Keys::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableKey>> vc;
         try
@@ -318,13 +372,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TKey>^)keyarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TValue>^ Region<TKey, TValue>::Values::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::Cacheable>> vc;
         try
@@ -344,13 +404,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TValue>^)valarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Add(TKey key, TValue value)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -363,13 +429,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Add(KeyValuePair<TKey, TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -382,13 +454,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Add(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -402,13 +480,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -420,14 +504,20 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(TKey key, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -440,13 +530,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(KeyValuePair<TKey, TValue> keyValuePair)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -459,13 +555,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::Remove(TKey key, TValue value, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -480,23 +582,35 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::InvalidateRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           InvalidateRegion(nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::InvalidateRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -508,23 +622,35 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::DestroyRegion()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           DestroyRegion(nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::DestroyRegion(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -536,24 +662,36 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Invalidate(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           Invalidate(key, nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Invalidate(TKey key, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -566,24 +704,36 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::PutAll(System::Collections::Generic::IDictionary<TKey, TValue>^ map)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           return PutAll(map, TimeUtils::DurationToTimeSpan(native::DEFAULT_RESPONSE_TIMEOUT));
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::PutAll(System::Collections::Generic::IDictionary<TKey, TValue>^ map, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           native::HashMapOfCacheable nativeMap;
         for each (KeyValuePair<TKey, TValue> keyValPair in map)
@@ -601,14 +751,20 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::PutAll(System::Collections::Generic::IDictionary<TKey, TValue>^ map, TimeSpan timeout, Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           native::HashMapOfCacheable nativeMap;
         for each (KeyValuePair<TKey, TValue> keyValPair in map)
@@ -627,7 +783,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -636,11 +798,17 @@ namespace Apache
                                         System::Collections::Generic::IDictionary<TKey, TValue>^ values,
                                         System::Collections::Generic::IDictionary<TKey, System::Exception^>^ exceptions)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           GetAll(keys, values, exceptions, false);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -651,7 +819,7 @@ namespace Apache
                                         bool addToLocalCache)
       {
         if (keys != nullptr) {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -679,7 +847,13 @@ namespace Apache
             }
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
         else {
           throw gcnew IllegalArgumentException("GetAll: null keys provided");
@@ -693,7 +867,7 @@ namespace Apache
                                         bool addToLocalCache, Object^ callbackArg)
       {
         if (keys != nullptr) {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
           std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -725,7 +899,13 @@ namespace Apache
             }
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
         else {
           throw gcnew IllegalArgumentException("GetAll: null keys provided");
@@ -735,11 +915,17 @@ namespace Apache
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::RemoveAll(System::Collections::Generic::ICollection<TKey>^ keys)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           RemoveAll(keys, nullptr);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -747,7 +933,7 @@ namespace Apache
       void Region<TKey, TValue>::RemoveAll(System::Collections::Generic::ICollection<TKey>^ keys,
                                             Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
         for each(TKey item in keys) 
@@ -767,7 +953,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
       generic<class TKey, class TValue>
@@ -799,7 +991,7 @@ namespace Apache
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ Region<TKey, TValue>::ParentRegion::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -811,13 +1003,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::RegionAttributes<TKey, TValue>^ Region<TKey, TValue>::Attributes::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -829,13 +1027,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       AttributesMutator<TKey, TValue>^ Region<TKey, TValue>::AttributesMutator::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -847,13 +1051,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       Apache::Geode::Client::CacheStatistics^ Region<TKey, TValue>::Statistics::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -865,13 +1075,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ Region<TKey, TValue>::GetSubRegion(String^ path)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -883,14 +1099,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ Region<TKey, TValue>::CreateSubRegion(String^ subRegionName,
                                                                     Apache::Geode::Client::RegionAttributes<TKey, TValue>^ attributes)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -902,14 +1124,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^ Region<TKey, TValue>::SubRegions(bool recursive)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           std::vector<std::shared_ptr<native::Region>> vsr;
         try
@@ -931,13 +1159,19 @@ namespace Apache
         auto collection = (System::Collections::Generic::ICollection<IRegion<TKey, TValue>^>^)subRegions;
         return collection;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       RegionEntry<TKey, TValue>^ Region<TKey, TValue>::GetEntry(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -950,13 +1184,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<RegionEntry<TKey, TValue>^>^ Region<TKey, TValue>::GetEntries(bool recursive)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
         try
@@ -978,7 +1218,13 @@ namespace Apache
 
         return collection;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -991,7 +1237,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::ContainsValueForKey(TKey key)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1003,13 +1249,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       int Region<TKey, TValue>::Count::get()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             return m_nativeptr->get()->size();
@@ -1018,7 +1270,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1030,7 +1288,7 @@ namespace Apache
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::Clear(Object^ callbackArg)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
         try
         {
           std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
@@ -1040,7 +1298,13 @@ namespace Apache
         {
           GC::KeepAlive(m_nativeptr);
         }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1056,7 +1320,7 @@ namespace Apache
           throw gcnew System::ArgumentOutOfRangeException;
         }
 
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::RegionEntry>> vc;
         try
@@ -1082,7 +1346,13 @@ namespace Apache
           ++startIdx;
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1118,7 +1388,7 @@ namespace Apache
       {
         if (keys != nullptr)
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -1136,7 +1406,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
       }
 
@@ -1145,7 +1421,7 @@ namespace Apache
       {
         if (keys != nullptr)
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
 
             std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
 
@@ -1164,7 +1440,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
       }
 
@@ -1192,7 +1474,7 @@ namespace Apache
                                                   bool getInitialValues,
                                                   bool receiveValues)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1203,13 +1485,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<TKey>^ Region<TKey, TValue>::GetInterestList()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableKey>> vc;
         try
@@ -1230,13 +1518,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<TKey>^)keyarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       System::Collections::Generic::ICollection<String^>^ Region<TKey, TValue>::GetInterestListRegex()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         std::vector<std::shared_ptr<native::CacheableString>> vc;
         try
@@ -1256,13 +1550,19 @@ namespace Apache
         auto collectionlist = (System::Collections::Generic::ICollection<String^>^)strarr;
         return collectionlist;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::UnregisterAllKeys()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -1273,7 +1573,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -1299,7 +1605,7 @@ namespace Apache
       void Region<TKey, TValue>::RegisterRegex(String^ regex, bool isDurable,
           bool getInitialValues, bool receiveValues)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1311,13 +1617,19 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
       void Region<TKey, TValue>::UnregisterRegex(String^ regex)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1328,7 +1640,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
       }
 
@@ -1343,7 +1661,7 @@ namespace Apache
       generic<class TResult>
       ISelectResults<TResult>^ Region<TKey, TValue>::Query(String^ predicate, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -1363,7 +1681,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1375,7 +1699,7 @@ namespace Apache
       generic<class TKey, class TValue>
       bool Region<TKey, TValue>::ExistsValue(String^ predicate, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -1386,7 +1710,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
@@ -1398,7 +1728,7 @@ namespace Apache
       generic<class TKey, class TValue>
       Object^ Region<TKey, TValue>::SelectValue(String^ predicate, TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
         try
         {
@@ -1410,7 +1740,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TKey, class TValue>
diff --git a/clicache/src/RegionAttributesFactory.cpp b/clicache/src/RegionAttributesFactory.cpp
index e8bd4aa..45d2299 100644
--- a/clicache/src/RegionAttributesFactory.cpp
+++ b/clicache/src/RegionAttributesFactory.cpp
@@ -357,7 +357,7 @@ namespace Apache
       generic<class TKey, class TValue>
       RegionAttributesFactory<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::SetInitialCapacity( System::Int32 initialCapacity )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -368,7 +368,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         return this;
       }
@@ -376,7 +382,7 @@ namespace Apache
       generic<class TKey, class TValue>
       RegionAttributesFactory<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::SetLoadFactor( Single loadFactor )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -387,7 +393,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         return this;
       }
@@ -395,7 +407,7 @@ namespace Apache
       generic<class TKey, class TValue>
       RegionAttributesFactory<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::SetConcurrencyLevel( System::Int32 concurrencyLevel )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -406,7 +418,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
 
         return this;
       }
@@ -485,7 +503,7 @@ namespace Apache
       generic<class TKey, class TValue>
       Apache::Geode::Client::RegionAttributes<TKey, TValue>^ RegionAttributesFactory<TKey, TValue>::Create()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -497,7 +515,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/RegionFactory.cpp b/clicache/src/RegionFactory.cpp
index d269f73..ad60f79 100644
--- a/clicache/src/RegionFactory.cpp
+++ b/clicache/src/RegionFactory.cpp
@@ -237,7 +237,7 @@ namespace Apache
 
       RegionFactory^ RegionFactory::SetInitialCapacity( System::Int32 initialCapacity )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -249,12 +249,18 @@ namespace Apache
           }
           return this;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ RegionFactory::SetLoadFactor( Single loadFactor )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -266,12 +272,18 @@ namespace Apache
           }
           return this;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ RegionFactory::SetConcurrencyLevel( System::Int32 concurrencyLevel )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -283,7 +295,13 @@ namespace Apache
           }
           return this;
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       RegionFactory^ RegionFactory::SetLruEntriesLimit( System::UInt32 entriesLimit )
@@ -355,7 +373,7 @@ namespace Apache
       generic <class TKey, class TValue>
       IRegion<TKey,TValue>^ RegionFactory::Create(String^ regionName)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -367,7 +385,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic <class TKey, class TValue>
diff --git a/clicache/src/ResultCollector.cpp b/clicache/src/ResultCollector.cpp
index 68f8d61..66798af 100644
--- a/clicache/src/ResultCollector.cpp
+++ b/clicache/src/ResultCollector.cpp
@@ -48,7 +48,7 @@ namespace Apache
       generic<class TResult>
       System::Collections::Generic::ICollection<TResult>^  ResultCollector<TResult>::GetResult(TimeSpan timeout)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             auto results = m_nativeptr->get()->getResult(TimeUtils::TimeSpanToDurationCeil<std::chrono::milliseconds>(timeout));
@@ -66,13 +66,19 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       void ResultCollector<TResult>::EndResults()
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             m_nativeptr->get()->endResults();
@@ -81,13 +87,19 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
       void ResultCollector<TResult>::ClearResults(/*bool*/)
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
           try
           {
             m_nativeptr->get()->clearResults();
@@ -96,7 +108,13 @@ namespace Apache
           {
             GC::KeepAlive(m_nativeptr);
           }
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/StructSet.cpp b/clicache/src/StructSet.cpp
index 185b36b..2c79265 100644
--- a/clicache/src/StructSet.cpp
+++ b/clicache/src/StructSet.cpp
@@ -72,7 +72,7 @@ namespace Apache
       generic<class TResult>
       int32_t StructSet<TResult>::GetFieldIndex( String^ fieldName )
       {
-        _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+        try {/* due to auto replace */
 
           try
           {
@@ -83,7 +83,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
       }
 
       generic<class TResult>
diff --git a/clicache/src/TypeRegistry.cpp b/clicache/src/TypeRegistry.cpp
index ea257b2..2315b41 100644
--- a/clicache/src/TypeRegistry.cpp
+++ b/clicache/src/TypeRegistry.cpp
@@ -223,12 +223,18 @@ namespace Apache
           ManagedTypeToDsCode[managedType] = dsCode;
         }
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
           auto&& serializationRegistry = CacheRegionHelper::getCacheImpl(m_cache->GetNative().get())->getSerializationRegistry();
           auto nativeDelegateFunction = static_cast<std::shared_ptr<native::Serializable>(*)()>(
               System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(nativeDelegate).ToPointer());
           serializationRegistry->setDataSerializablePrimitiveType(nativeDelegateFunction, static_cast<DSCode>(dsCode));
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void TypeRegistry::RegisterDataSerializableFixedIdTypeOverrideNativeDeserialization(
@@ -246,22 +252,34 @@ namespace Apache
 
         Log::Finer("Registering serializable fixed ID " + fixedId);
 
-        _GF_MG_EXCEPTION_TRY2
+        try {
           auto&& serializationRegistry = CacheRegionHelper::getCacheImpl(m_cache->GetNative().get())->getSerializationRegistry();
           auto nativeDelegateFunction = static_cast<std::shared_ptr<native::Serializable>(*)()>(
               System::Runtime::InteropServices::Marshal::GetFunctionPointerForDelegate(nativeDelegate).ToPointer());
           serializationRegistry->addDataSerializableFixedIdType(static_cast<internal::DSFid>(fixedId), nativeDelegateFunction);
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void TypeRegistry::UnregisterTypeGeneric(Byte typeId)
       {
         DsCodeToDataSerializablePrimitiveNativeDelegate->Remove(typeId);
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           CacheRegionHelper::getCacheImpl(m_cache->GetNative().get())->getSerializationRegistry()->removeDataSerializableType(typeId);
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       void TypeRegistry::RegisterDataSerializablePrimitiveWrapper(
diff --git a/clicache/src/UserFunctionExecutionException.cpp b/clicache/src/UserFunctionExecutionException.cpp
index abec0c7..869ffc6 100644
--- a/clicache/src/UserFunctionExecutionException.cpp
+++ b/clicache/src/UserFunctionExecutionException.cpp
@@ -37,7 +37,7 @@ namespace Apache
 
       String^ UserFunctionExecutionException::Message::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         try
         {
@@ -49,12 +49,18 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       String^ UserFunctionExecutionException::Name::get()
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
         try
         {
@@ -66,7 +72,13 @@ namespace Apache
           GC::KeepAlive(m_nativeptr);
         }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/impl/AuthenticatedView.cpp b/clicache/src/impl/AuthenticatedView.cpp
index 3c91d54..7830a33 100644
--- a/clicache/src/impl/AuthenticatedView.cpp
+++ b/clicache/src/impl/AuthenticatedView.cpp
@@ -56,7 +56,7 @@ namespace Apache
 
       void AuthenticatedView::Close( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -67,14 +67,20 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       
 			//TODO::split
       generic<class TKey, class TValue>
       IRegion<TKey, TValue>^ AuthenticatedView::GetRegion( String^ path )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -86,12 +92,18 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
       
       Client::QueryService^ AuthenticatedView::GetQueryService( )
       {
-        _GF_MG_EXCEPTION_TRY2
+        try {
 
           try
           {
@@ -102,7 +114,13 @@ namespace Apache
             GC::KeepAlive(m_nativeptr);
           }
 
-        _GF_MG_EXCEPTION_CATCH_ALL2
+        }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }
       }
 
       generic<class TKey, class TValue>
diff --git a/clicache/src/impl/GeodeDataInputStream.hpp b/clicache/src/impl/GeodeDataInputStream.hpp
index 138c542..bb2f1fe 100644
--- a/clicache/src/impl/GeodeDataInputStream.hpp
+++ b/clicache/src/impl/GeodeDataInputStream.hpp
@@ -97,7 +97,7 @@ namespace Apache
 
         virtual int Read(array<Byte> ^ buffer, int offset, int count) override
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           auto bytesRemaining = static_cast<int>(m_maxSize - m_buffer->BytesReadInternally);
 					if(bytesRemaining <= 0)
 						return bytesRemaining;
@@ -114,7 +114,13 @@ namespace Apache
             m_position += actual;
           }
           return actual;
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
 
         virtual void Flush() override { /* do nothing */ }
diff --git a/clicache/src/impl/GeodeDataOutputStream.hpp b/clicache/src/impl/GeodeDataOutputStream.hpp
index 6c7ed02..5bed23c 100644
--- a/clicache/src/impl/GeodeDataOutputStream.hpp
+++ b/clicache/src/impl/GeodeDataOutputStream.hpp
@@ -81,7 +81,7 @@ namespace Apache
 
         virtual void Write(array<Byte> ^ buffer, int offset, int count) override
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           /*
           array<Byte> ^ chunk = gcnew array<Byte>(count);
           array<Byte>::ConstrainedCopy(buffer, offset, chunk, 0, count);
@@ -91,15 +91,27 @@ namespace Apache
           //m_buffer->NativePtr->writeBytesOnly((const System::Byte*)pin_bytes, count);
           m_buffer->WriteBytesOnly(buffer, count, offset);
           m_position += count;
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
 
         virtual void WriteByte(unsigned char value) override
         {
-          _GF_MG_EXCEPTION_TRY2/* due to auto replace */
+          try {/* due to auto replace */
           m_buffer->WriteByte(value);
           m_position++;
-          _GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
+          }
+        catch (const apache::geode::client::Exception& ex) {
+          throw Apache::Geode::Client::GeodeException::Get(ex);
+        }
+        catch (System::AccessViolationException^ ex) {
+          throw ex;
+        }/* due to auto replace */
         }
 
         virtual int Read(array<Byte> ^ buffer, int offset, int count) override

[geode-native] 02/05: Demacroize: DEF3 and DEF4

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit 6b2a668b36d254507c6a80e9cccf726147b779b2
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Sat Aug 28 08:51:44 2021 -0700

    Demacroize: DEF3 and DEF4
---
 clicache/src/ExceptionTypes.hpp | 285 ++++++++++++++++++++--------------------
 1 file changed, 143 insertions(+), 142 deletions(-)

diff --git a/clicache/src/ExceptionTypes.hpp b/clicache/src/ExceptionTypes.hpp
index 00a9716..83181b8 100644
--- a/clicache/src/ExceptionTypes.hpp
+++ b/clicache/src/ExceptionTypes.hpp
@@ -267,87 +267,87 @@ namespace Apache
       };
 
 /// Creates a class <c>x</c> named for each exception <c>y</c>.
-#define _GF_MG_EXCEPTION_DEF4(x,y) \
-      [Serializable] \
-      public ref class x: public GeodeException \
-      { \
-      public: \
-      \
-        /** <summary>Default constructor</summary> */ \
-        x( ) \
-          : GeodeException( ) { } \
-        \
-        /** <summary>
-         *  Constructor to create an exception object with the given message.
-         *  </summary>
-         *  <param name="message">The exception message.</param>
-         */ \
-        x( String^ message ) \
-          : GeodeException( message ) { } \
-        \
-        /** <summary>
-         *  Constructor to create an exception object with the given message
-         *  and with the given inner exception.
-         *  </summary>
-         *  <param name="message">The exception message.</param>
-         *  <param name="innerException">The inner exception object.</param>
-         */ \
-        x( String^ message, System::Exception^ innerException ) \
-          : GeodeException( message, innerException ) { } \
-        \
-      protected: \
-      \
-        /** <summary>
-         *  Initializes a new instance of the class with serialized data.
-         *  This allows deserialization of this exception in .NET remoting.
-         *  </summary>
-         *  <param name="info">
-         *  holds the serialized object data about the exception being thrown
-         *  </param>
-         *  <param name="context">
-         *  contains contextual information about the source or destination
-         *  </param>
-         */ \
-        x( SerializationInfo^ info, StreamingContext context ) \
-          : GeodeException( info, context ) { } \
-      \
-      internal: \
-        x(const apache::geode::client::y& nativeEx) \
-          : GeodeException(marshal_as<String^>(nativeEx.getMessage()), \
-              gcnew GeodeException(GeodeException::GetStackTrace( \
-                nativeEx))) { } \
-        \
-        x(const apache::geode::client::y& nativeEx, Exception^ innerException) \
-          : GeodeException(marshal_as<String^>(nativeEx.getMessage()), \
-              innerException) { } \
-        \
-        static GeodeException^ Create(const apache::geode::client::Exception& ex, \
-            Exception^ innerException) \
-        { \
-          const apache::geode::client::y* nativeEx = dynamic_cast<const apache::geode::client::y*>( &ex ); \
-          if (nativeEx != nullptr) { \
-            if (innerException == nullptr) { \
-              return gcnew x(*nativeEx); \
-            } \
-            else { \
-              return gcnew x(*nativeEx, innerException); \
-            } \
-          } \
-          return nullptr; \
-        } \
-        virtual std::shared_ptr<apache::geode::client::Exception> GetNative() override \
-        { \
-          auto message = marshal_as<std::string>(this->Message + ": " + this->StackTrace); \
-          if (this->InnerException != nullptr) { \
-            auto cause = GeodeException::GetNative(this->InnerException); \
-            message += "Caused by: " + cause->getMessage(); \
-          } \
-          return std::make_shared<apache::geode::client::y>(message); \
-        } \
-      }
-
-/// Creates a class named for each exception <c>x</c>.
-#define _GF_MG_EXCEPTION_DEF3(x) _GF_MG_EXCEPTION_DEF4(x,x)
+//#define _GF_MG_EXCEPTION_DEF4(x,y) \
+//      [Serializable] \
+//      public ref class x: public GeodeException \
+//      { \
+//      public: \
+//      \
+//        /** <summary>Default constructor</summary> */ \
+//        x( ) \
+//          : GeodeException( ) { } \
+//        \
+//        /** <summary>
+//         *  Constructor to create an exception object with the given message.
+//         *  </summary>
+//         *  <param name="message">The exception message.</param>
+//         */ \
+//        x( String^ message ) \
+//          : GeodeException( message ) { } \
+//        \
+//        /** <summary>
+//         *  Constructor to create an exception object with the given message
+//         *  and with the given inner exception.
+//         *  </summary>
+//         *  <param name="message">The exception message.</param>
+//         *  <param name="innerException">The inner exception object.</param>
+//         */ \
+//        x( String^ message, System::Exception^ innerException ) \
+//          : GeodeException( message, innerException ) { } \
+//        \
+//      protected: \
+//      \
+//        /** <summary>
+//         *  Initializes a new instance of the class with serialized data.
+//         *  This allows deserialization of this exception in .NET remoting.
+//         *  </summary>
+//         *  <param name="info">
+//         *  holds the serialized object data about the exception being thrown
+//         *  </param>
+//         *  <param name="context">
+//         *  contains contextual information about the source or destination
+//         *  </param>
+//         */ \
+//        x( SerializationInfo^ info, StreamingContext context ) \
+//          : GeodeException( info, context ) { } \
+//      \
+//      internal: \
+//        x(const apache::geode::client::y& nativeEx) \
+//          : GeodeException(marshal_as<String^>(nativeEx.getMessage()), \
+//              gcnew GeodeException(GeodeException::GetStackTrace( \
+//                nativeEx))) { } \
+//        \
+//        x(const apache::geode::client::y& nativeEx, Exception^ innerException) \
+//          : GeodeException(marshal_as<String^>(nativeEx.getMessage()), \
+//              innerException) { } \
+//        \
+//        static GeodeException^ Create(const apache::geode::client::Exception& ex, \
+//            Exception^ innerException) \
+//        { \
+//          const apache::geode::client::y* nativeEx = dynamic_cast<const apache::geode::client::y*>( &ex ); \
+//          if (nativeEx != nullptr) { \
+//            if (innerException == nullptr) { \
+//              return gcnew x(*nativeEx); \
+//            } \
+//            else { \
+//              return gcnew x(*nativeEx, innerException); \
+//            } \
+//          } \
+//          return nullptr; \
+//        } \
+//        virtual std::shared_ptr<apache::geode::client::Exception> GetNative() override \
+//        { \
+//          auto message = marshal_as<std::string>(this->Message + ": " + this->StackTrace); \
+//          if (this->InnerException != nullptr) { \
+//            auto cause = GeodeException::GetNative(this->InnerException); \
+//            message += "Caused by: " + cause->getMessage(); \
+//          } \
+//          return std::make_shared<apache::geode::client::y>(message); \
+//        } \
+//      }
+//
+///// Creates a class named for each exception <c>x</c>.
+//#define _GF_MG_EXCEPTION_DEF3(x) _GF_MG_EXCEPTION_DEF4(x,x)
 
 
       // For all the native Geode C++ exceptions, a corresponding definition
@@ -357,312 +357,313 @@ namespace Apache
       /// <summary>
       /// A geode assertion exception.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( AssertionException );
+      [Serializable] public ref class AssertionException: public GeodeException { public: AssertionException( ) : GeodeException( ) { } AssertionException( String^ message ) : GeodeException( message ) { } AssertionException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: AssertionException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: AssertionException(const apache::g [...]
 
       /// <summary>
       /// Thrown when an argument to a method is illegal.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( IllegalArgumentException );
+      [Serializable] public ref class IllegalArgumentException: public GeodeException { public: IllegalArgumentException( ) : GeodeException( ) { } IllegalArgumentException( String^ message ) : GeodeException( message ) { } IllegalArgumentException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: IllegalArgumentException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: Ille [...]
 
       /// <summary>
       /// Thrown when the state of cache is manipulated to be illegal.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( IllegalStateException );
+      [Serializable] public ref class IllegalStateException: public GeodeException { public: IllegalStateException( ) : GeodeException( ) { } IllegalStateException( String^ message ) : GeodeException( message ) { } IllegalStateException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: IllegalStateException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: IllegalStateExcepti [...]
 
       /// <summary>
       /// Thrown when an attempt is made to create an existing cache.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheExistsException );
+      [Serializable] public ref class CacheExistsException: public GeodeException { public: CacheExistsException( ) : GeodeException( ) { } CacheExistsException( String^ message ) : GeodeException( message ) { } CacheExistsException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheExistsException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheExistsException(con [...]
 
       /// <summary>
       /// Thrown when the cache xml is incorrect.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheXmlException );
+      [Serializable] public ref class CacheXmlException: public GeodeException { public: CacheXmlException( ) : GeodeException( ) { } CacheXmlException( String^ message ) : GeodeException( message ) { } CacheXmlException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheXmlException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheXmlException(const apache::geode:: [...]
 
       /// <summary>
       /// Thrown when a timout occurs.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( TimeoutException );
+      [Serializable] public ref class TimeoutException: public GeodeException { public: TimeoutException( ) : GeodeException( ) { } TimeoutException( String^ message ) : GeodeException( message ) { } TimeoutException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: TimeoutException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: TimeoutException(const apache::geode::client [...]
 
       /// <summary>
       /// Thrown when the cache writer aborts the operation.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheWriterException );
+      [Serializable] public ref class CacheWriterException: public GeodeException { public: CacheWriterException( ) : GeodeException( ) { } CacheWriterException( String^ message ) : GeodeException( message ) { } CacheWriterException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheWriterException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheWriterException(con [...]
 
       /// <summary>
       /// Thrown when the cache listener throws an exception.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheListenerException );
+      [Serializable] public ref class CacheListenerException: public GeodeException { public: CacheListenerException( ) : GeodeException( ) { } CacheListenerException( String^ message ) : GeodeException( message ) { } CacheListenerException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheListenerException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheListenerE [...]
 
       /// <summary>
       /// Thrown when an attempt is made to create an existing region.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( RegionExistsException );
+      [Serializable] public ref class RegionExistsException: public GeodeException { public: RegionExistsException( ) : GeodeException( ) { } RegionExistsException( String^ message ) : GeodeException( message ) { } RegionExistsException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: RegionExistsException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: RegionExistsExcepti [...]
 
       /// <summary>
       /// Thrown when an operation is attempted on a closed cache.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheClosedException );
+      [Serializable] public ref class CacheClosedException: public GeodeException { public: CacheClosedException( ) : GeodeException( ) { } CacheClosedException( String^ message ) : GeodeException( message ) { } CacheClosedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheClosedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheClosedException(con [...]
 
       /// <summary>
       /// Thrown when lease of cache proxy has expired.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( LeaseExpiredException );
+      [Serializable] public ref class LeaseExpiredException: public GeodeException { public: LeaseExpiredException( ) : GeodeException( ) { } LeaseExpiredException( String^ message ) : GeodeException( message ) { } LeaseExpiredException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: LeaseExpiredException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: LeaseExpiredExcepti [...]
 
       /// <summary>
       /// Thrown when the cache loader aborts the operation.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheLoaderException );
+      [Serializable] public ref class CacheLoaderException: public GeodeException { public: CacheLoaderException( ) : GeodeException( ) { } CacheLoaderException( String^ message ) : GeodeException( message ) { } CacheLoaderException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheLoaderException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheLoaderException(con [...]
 
       /// <summary>
       /// Thrown when an operation is attempted on a destroyed region.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( RegionDestroyedException );
+      [Serializable] public ref class RegionDestroyedException: public GeodeException { public: RegionDestroyedException( ) : GeodeException( ) { } RegionDestroyedException( String^ message ) : GeodeException( message ) { } RegionDestroyedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: RegionDestroyedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: Regi [...]
 
       /// <summary>
       /// Thrown when an operation is attempted on a destroyed entry.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( EntryDestroyedException );
+      [Serializable] public ref class EntryDestroyedException: public GeodeException { public: EntryDestroyedException( ) : GeodeException( ) { } EntryDestroyedException( String^ message ) : GeodeException( message ) { } EntryDestroyedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: EntryDestroyedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: EntryDest [...]
 
       /// <summary>
       /// Thrown when the connecting target is not running.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( NoSystemException );
+      [Serializable] public ref class NoSystemException: public GeodeException { public: NoSystemException( ) : GeodeException( ) { } NoSystemException( String^ message ) : GeodeException( message ) { } NoSystemException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: NoSystemException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: NoSystemException(const apache::geode:: [...]
 
       /// <summary>
       /// Thrown when an attempt is made to connect to
       /// DistributedSystem second time.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( AlreadyConnectedException );
+      [Serializable] public ref class AlreadyConnectedException: public GeodeException { public: AlreadyConnectedException( ) : GeodeException( ) { } AlreadyConnectedException( String^ message ) : GeodeException( message ) { } AlreadyConnectedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: AlreadyConnectedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: [...]
 
       /// <summary>
       /// Thrown when a non-existing file is accessed.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( FileNotFoundException );
+      [Serializable] public ref class FileNotFoundException: public GeodeException { public: FileNotFoundException( ) : GeodeException( ) { } FileNotFoundException( String^ message ) : GeodeException( message ) { } FileNotFoundException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: FileNotFoundException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: FileNotFoundExcepti [...]
 
       /// <summary>
       /// Thrown when an operation is interrupted.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( InterruptedException );
+      [Serializable] public ref class InterruptedException: public GeodeException { public: InterruptedException( ) : GeodeException( ) { } InterruptedException( String^ message ) : GeodeException( message ) { } InterruptedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: InterruptedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: InterruptedException(con [...]
 
       /// <summary>
       /// Thrown when an operation unsupported by the
       /// current configuration is attempted.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( UnsupportedOperationException );
+      [Serializable] public ref class UnsupportedOperationException: public GeodeException { public: UnsupportedOperationException( ) : GeodeException( ) { } UnsupportedOperationException( String^ message ) : GeodeException( message ) { } UnsupportedOperationException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: UnsupportedOperationException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, con [...]
 
       /// <summary>
       /// Thrown when statistics are invoked for a region where
       /// they are disabled.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( StatisticsDisabledException );
+      [Serializable] public ref class StatisticsDisabledException: public GeodeException { public: StatisticsDisabledException( ) : GeodeException( ) { } StatisticsDisabledException( String^ message ) : GeodeException( message ) { } StatisticsDisabledException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: StatisticsDisabledException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } [...]
 
       /// <summary>
       /// Thrown when a concurrent operation fails.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( ConcurrentModificationException );
+      [Serializable] public ref class ConcurrentModificationException: public GeodeException { public: ConcurrentModificationException( ) : GeodeException( ) { } ConcurrentModificationException( String^ message ) : GeodeException( message ) { } ConcurrentModificationException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: ConcurrentModificationException( SerializationInfo^ info, StreamingContext context ) : GeodeException( [...]
 
       /// <summary>
       /// An unknown exception occurred.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( UnknownException );
+      [Serializable] public ref class UnknownException: public GeodeException { public: UnknownException( ) : GeodeException( ) { } UnknownException( String^ message ) : GeodeException( message ) { } UnknownException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: UnknownException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: UnknownException(const apache::geode::client [...]
 
       /// <summary>
       /// Thrown when a cast operation fails.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( ClassCastException );
+      [Serializable] public ref class ClassCastException: public GeodeException { public: ClassCastException( ) : GeodeException( ) { } ClassCastException( String^ message ) : GeodeException( message ) { } ClassCastException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: ClassCastException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: ClassCastException(const apache::g [...]
 
       /// <summary>
       /// Thrown when an operation is attempted on a non-existent entry.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( EntryNotFoundException );
+      [Serializable] public ref class EntryNotFoundException: public GeodeException { public: EntryNotFoundException( ) : GeodeException( ) { } EntryNotFoundException( String^ message ) : GeodeException( message ) { } EntryNotFoundException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: EntryNotFoundException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: EntryNotFoundE [...]
 
       /// <summary>
       /// Thrown when there is an input/output error.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF4( GeodeIOException, GeodeIOException );
+      [Serializable] public ref class GeodeIOException: public GeodeException { public: GeodeIOException( ) : GeodeException( ) { } GeodeIOException( String^ message ) : GeodeException( message ) { } GeodeIOException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: GeodeIOException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: GeodeIOException(const apache::geode::client [...]
 
       /// <summary>
       /// Thrown when geode configuration file is incorrect.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF4( GeodeConfigException, GeodeConfigException );
+      [Serializable] public ref class GeodeConfigException: public GeodeException { public: GeodeConfigException( ) : GeodeException( ) { } GeodeConfigException( String^ message ) : GeodeException( message ) { } GeodeConfigException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: GeodeConfigException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: GeodeConfigException(con [...]
 
       /// <summary>
       /// Thrown when a null argument is provided to a method
       /// where it is expected to be non-null.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( NullPointerException );
+      [Serializable] public ref class NullPointerException: public GeodeException { public: NullPointerException( ) : GeodeException( ) { } NullPointerException( String^ message ) : GeodeException( message ) { } NullPointerException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: NullPointerException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: NullPointerException(con [...]
 
       /// <summary>
       /// Thrown when attempt is made to create an existing entry.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( EntryExistsException );
+      [Serializable] public ref class EntryExistsException: public GeodeException { public: EntryExistsException( ) : GeodeException( ) { } EntryExistsException( String^ message ) : GeodeException( message ) { } EntryExistsException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: EntryExistsException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: EntryExistsException(con [...]
 
       /// <summary>
       /// Thrown when an operation is attempted before connecting
       /// to the distributed system.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( NotConnectedException );
+      [Serializable] public ref class NotConnectedException: public GeodeException { public: NotConnectedException( ) : GeodeException( ) { } NotConnectedException( String^ message ) : GeodeException( message ) { } NotConnectedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: NotConnectedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: NotConnectedExcepti [...]
 
       /// <summary>
       /// Thrown when there is an error in the cache proxy.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheProxyException );
+      [Serializable] public ref class CacheProxyException: public GeodeException { public: CacheProxyException( ) : GeodeException( ) { } CacheProxyException( String^ message ) : GeodeException( message ) { } CacheProxyException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheProxyException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheProxyException(const apa [...]
 
       /// <summary>
       /// Thrown when the system cannot allocate any more memory.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( OutOfMemoryException );
+      [Serializable] public ref class OutOfMemoryException: public GeodeException { public: OutOfMemoryException( ) : GeodeException( ) { } OutOfMemoryException( String^ message ) : GeodeException( message ) { } OutOfMemoryException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: OutOfMemoryException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: OutOfMemoryException(con [...]
 
       /// <summary>
       /// Thrown when an attempt is made to release a lock not
       /// owned by the thread.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( NotOwnerException );
+      [Serializable] public ref class NotOwnerException: public GeodeException { public: NotOwnerException( ) : GeodeException( ) { } NotOwnerException( String^ message ) : GeodeException( message ) { } NotOwnerException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: NotOwnerException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: NotOwnerException(const apache::geode:: [...]
 
       /// <summary>
       /// Thrown when a region is created in an incorrect scope.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( WrongRegionScopeException );
+      [Serializable] public ref class WrongRegionScopeException: public GeodeException { public: WrongRegionScopeException( ) : GeodeException( ) { } WrongRegionScopeException( String^ message ) : GeodeException( message ) { } WrongRegionScopeException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: WrongRegionScopeException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: [...]
 
       /// <summary>
       /// Thrown when the internal buffer size is exceeded.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( BufferSizeExceededException );
+      [Serializable] public ref class BufferSizeExceededException: public GeodeException { public: BufferSizeExceededException( ) : GeodeException( ) { } BufferSizeExceededException( String^ message ) : GeodeException( message ) { } BufferSizeExceededException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: BufferSizeExceededException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } [...]
 
       /// <summary>
       /// Thrown when a region creation operation fails.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( RegionCreationFailedException );
+      [Serializable] public ref class RegionCreationFailedException: public GeodeException { public: RegionCreationFailedException( ) : GeodeException( ) { } RegionCreationFailedException( String^ message ) : GeodeException( message ) { } RegionCreationFailedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: RegionCreationFailedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, con [...]
 
       /// <summary>
       /// Thrown when there is a fatal internal exception in Geode.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( FatalInternalException );
+      [Serializable] public ref class FatalInternalException: public GeodeException { public: FatalInternalException( ) : GeodeException( ) { } FatalInternalException( String^ message ) : GeodeException( message ) { } FatalInternalException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: FatalInternalException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: FatalInternalE [...]
 
       /// <summary>
       /// Thrown by the persistence manager when a write
       /// fails due to disk failure.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( DiskFailureException );
+      [Serializable] public ref class DiskFailureException: public GeodeException { public: DiskFailureException( ) : GeodeException( ) { } DiskFailureException( String^ message ) : GeodeException( message ) { } DiskFailureException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: DiskFailureException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: DiskFailureException(con [...]
 
       /// <summary>
       /// Thrown by the persistence manager when the data
       /// to be read from disk is corrupt.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( DiskCorruptException );
+      [Serializable] public ref class DiskCorruptException: public GeodeException { public: DiskCorruptException( ) : GeodeException( ) { } DiskCorruptException( String^ message ) : GeodeException( message ) { } DiskCorruptException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: DiskCorruptException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: DiskCorruptException(con [...]
 
       /// <summary>
       /// Thrown when persistence manager fails to initialize.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( InitFailedException );
+      [Serializable] public ref class InitFailedException: public GeodeException { public: InitFailedException( ) : GeodeException( ) { } InitFailedException( String^ message ) : GeodeException( message ) { } InitFailedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: InitFailedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: InitFailedException(const apa [...]
 
       /// <summary>
       /// Thrown when persistence manager fails to close properly.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( ShutdownFailedException );
+      [Serializable] public ref class ShutdownFailedException: public GeodeException { public: ShutdownFailedException( ) : GeodeException( ) { } ShutdownFailedException( String^ message ) : GeodeException( message ) { } ShutdownFailedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: ShutdownFailedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: ShutdownF [...]
 
       /// <summary>
       /// Thrown when an exception occurs on the cache server.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CacheServerException );
+      [Serializable] public ref class CacheServerException: public GeodeException { public: CacheServerException( ) : GeodeException( ) { } CacheServerException( String^ message ) : GeodeException( message ) { } CacheServerException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CacheServerException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CacheServerException(con [...]
 
       /// <summary>
       /// Thrown when bound of array/vector etc. is exceeded.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( OutOfRangeException );
+      [Serializable] public ref class OutOfRangeException: public GeodeException { public: OutOfRangeException( ) : GeodeException( ) { } OutOfRangeException( String^ message ) : GeodeException( message ) { } OutOfRangeException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: OutOfRangeException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: OutOfRangeException(const apa [...]
 
       /// <summary>
       /// Thrown when query exception occurs at the server.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( QueryException );
+      [Serializable] public ref class QueryException: public GeodeException { public: QueryException( ) : GeodeException( ) { } QueryException( String^ message ) : GeodeException( message ) { } QueryException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: QueryException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: QueryException(const apache::geode::client::QueryExcep [...]
 
       /// <summary>
       /// Thrown when an unknown message is received from the server.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( MessageException );
+      [Serializable] public ref class MessageException: public GeodeException { public: MessageException( ) : GeodeException( ) { } MessageException( String^ message ) : GeodeException( message ) { } MessageException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: MessageException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: MessageException(const apache::geode::client [...]
 
       /// <summary>
       /// Thrown when a client operation is not authorized on the server.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( NotAuthorizedException );
+      [Serializable] public ref class NotAuthorizedException: public GeodeException { public: NotAuthorizedException( ) : GeodeException( ) { } NotAuthorizedException( String^ message ) : GeodeException( message ) { } NotAuthorizedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: NotAuthorizedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: NotAuthorizedE [...]
 
       /// <summary>
       /// Thrown when authentication to the server fails.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( AuthenticationFailedException );
+      [Serializable] public ref class AuthenticationFailedException: public GeodeException { public: AuthenticationFailedException( ) : GeodeException( ) { } AuthenticationFailedException( String^ message ) : GeodeException( message ) { } AuthenticationFailedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: AuthenticationFailedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, con [...]
 
       /// <summary>
       /// Thrown when credentials are not provided to a server which expects them.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( AuthenticationRequiredException );
+      [Serializable] public ref class AuthenticationRequiredException: public GeodeException { public: AuthenticationRequiredException( ) : GeodeException( ) { } AuthenticationRequiredException( String^ message ) : GeodeException( message ) { } AuthenticationRequiredException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: AuthenticationRequiredException( SerializationInfo^ info, StreamingContext context ) : GeodeException( [...]
 
       /// <summary>
       /// Thrown when a duplicate durable client id is provided to the server.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( DuplicateDurableClientException );
+      [Serializable] public ref class DuplicateDurableClientException: public GeodeException { public: DuplicateDurableClientException( ) : GeodeException( ) { } DuplicateDurableClientException( String^ message ) : GeodeException( message ) { } DuplicateDurableClientException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: DuplicateDurableClientException( SerializationInfo^ info, StreamingContext context ) : GeodeException( [...]
 
       /// <summary>
       /// Thrown when a client is unable to contact any locators.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( NoAvailableLocatorsException );
+      [Serializable] public ref class NoAvailableLocatorsException: public GeodeException { public: NoAvailableLocatorsException( ) : GeodeException( ) { } NoAvailableLocatorsException( String^ message ) : GeodeException( message ) { } NoAvailableLocatorsException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: NoAvailableLocatorsException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context  [...]
 
       /// <summary>
       /// Thrown when all connections in a pool are in use..
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( AllConnectionsInUseException );
+      [Serializable] public ref class AllConnectionsInUseException: public GeodeException { public: AllConnectionsInUseException( ) : GeodeException( ) { } AllConnectionsInUseException( String^ message ) : GeodeException( message ) { } AllConnectionsInUseException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: AllConnectionsInUseException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context  [...]
 
       /// <summary>
       /// Thrown when cq is invalid
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CqInvalidException );
+      [Serializable] public ref class CqInvalidException: public GeodeException { public: CqInvalidException( ) : GeodeException( ) { } CqInvalidException( String^ message ) : GeodeException( message ) { } CqInvalidException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CqInvalidException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CqInvalidException(const apache::g [...]
 
       /// <summary>
       /// Thrown when function execution failed
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( FunctionExecutionException );
+      [Serializable] public ref class FunctionExecutionException: public GeodeException { public: FunctionExecutionException( ) : GeodeException( ) { } FunctionExecutionException( String^ message ) : GeodeException( message ) { } FunctionExecutionException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: FunctionExecutionException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } inte [...]
 
       /// <summary>
       /// Thrown during continuous query execution time.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CqException );
+      [Serializable] public ref class CqException: public GeodeException { public: CqException( ) : GeodeException( ) { } CqException( String^ message ) : GeodeException( message ) { } CqException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CqException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CqException(const apache::geode::client::CqException& nativeEx) : Geo [...]
 
       /// <summary>
       /// Thrown if the Cq on which the operaion performed is closed
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CqClosedException );
+      [Serializable] public ref class CqClosedException: public GeodeException { public: CqClosedException( ) : GeodeException( ) { } CqClosedException( String^ message ) : GeodeException( message ) { } CqClosedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CqClosedException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CqClosedException(const apache::geode:: [...]
 
       /// <summary>
       /// Thrown if the Cq Query failed
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CqQueryException );
+      [Serializable] public ref class CqQueryException: public GeodeException { public: CqQueryException( ) : GeodeException( ) { } CqQueryException( String^ message ) : GeodeException( message ) { } CqQueryException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CqQueryException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CqQueryException(const apache::geode::client [...]
 
       /// <summary>
       /// Thrown if a Cq by this name already exists on this client
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CqExistsException );
+      [Serializable] public ref class CqExistsException: public GeodeException { public: CqExistsException( ) : GeodeException( ) { } CqExistsException( String^ message ) : GeodeException( message ) { } CqExistsException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CqExistsException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CqExistsException(const apache::geode:: [...]
 
-      _GF_MG_EXCEPTION_DEF3( InvalidDeltaException );
+      [Serializable] public ref class InvalidDeltaException: public GeodeException { public: InvalidDeltaException( ) : GeodeException( ) { } InvalidDeltaException( String^ message ) : GeodeException( message ) { } InvalidDeltaException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: InvalidDeltaException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: InvalidDeltaExcepti [...]
 
       /// <summary>
       /// Thrown if a Key is not present in the region.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( KeyNotFoundException );
+      [Serializable] public ref class KeyNotFoundException: public GeodeException { public: KeyNotFoundException( ) : GeodeException( ) { } KeyNotFoundException( String^ message ) : GeodeException( message ) { } KeyNotFoundException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: KeyNotFoundException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: KeyNotFoundException(con [...]
 
       /// <summary>
       /// Thrown if commit fails.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( CommitConflictException );
+      [Serializable] public ref class CommitConflictException: public GeodeException { public: CommitConflictException( ) : GeodeException( ) { } CommitConflictException( String^ message ) : GeodeException( message ) { } CommitConflictException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: CommitConflictException( SerializationInfo^ info, StreamingContext context ) : GeodeException( info, context ) { } internal: CommitCon [...]
 
 	        /// <summary>
       /// Thrown if transaction delegate went down.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( TransactionDataNodeHasDepartedException );
+      [Serializable] public ref class TransactionDataNodeHasDepartedException: public GeodeException { public: TransactionDataNodeHasDepartedException( ) : GeodeException( ) { } TransactionDataNodeHasDepartedException( String^ message ) : GeodeException( message ) { } TransactionDataNodeHasDepartedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: TransactionDataNodeHasDepartedException( SerializationInfo^ info, Stre [...]
 
 	        /// <summary>
       /// Thrown if commit rebalance happens during a transaction.
       /// </summary>
-      _GF_MG_EXCEPTION_DEF3( TransactionDataRebalancedException );
+      [Serializable] public ref class TransactionDataRebalancedException: public GeodeException { public: TransactionDataRebalancedException( ) : GeodeException( ) { } TransactionDataRebalancedException( String^ message ) : GeodeException( message ) { } TransactionDataRebalancedException( String^ message, System::Exception^ innerException ) : GeodeException( message, innerException ) { } protected: TransactionDataRebalancedException( SerializationInfo^ info, StreamingContext context ) :  [...]
+
     }  // namespace Client
   }  // namespace Geode
 }  // namespace Apache

[geode-native] 04/05: GEODE-9559: Demacroize _GFCLI_CACHEABLEHASHSET_DEF_GENERIC

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit c8af94e12a4b420e079cf8a2cb6a13ce0e1298cc
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Sat Aug 28 13:29:08 2021 -0700

    GEODE-9559: Demacroize _GFCLI_CACHEABLEHASHSET_DEF_GENERIC
---
 clicache/src/CacheableHashSet.hpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/clicache/src/CacheableHashSet.hpp b/clicache/src/CacheableHashSet.hpp
index 31a9a8a..d3c42fb 100644
--- a/clicache/src/CacheableHashSet.hpp
+++ b/clicache/src/CacheableHashSet.hpp
@@ -665,8 +665,7 @@ namespace Apache
       /// A mutable <c>ICacheableKey</c> hash set wrapper that can serve as
       /// a distributable object for caching.
       /// </summary>
-      _GFCLI_CACHEABLEHASHSET_DEF_GENERIC(CacheableHashSet,
-                                          apache::geode::client::CacheableHashSet);
+      public ref class CacheableHashSet : public Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::CacheableHashSet), apache::geode::client::CacheableHashSet> { public: inline CacheableHashSet() : Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::CacheableHashSet), apache::geode::client::CacheableHashSet>() {} inline CacheableHashSet(System::Int32 size) : Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::Cac [...]
 
       /// <summary>
       /// A mutable <c>ICacheableKey</c> hash set wrapper that can serve as
@@ -675,8 +674,7 @@ namespace Apache
       /// <c>CacheableHashSet</c> i.e. does not provide the linked semantics of
       /// java <c>LinkedHashSet</c>.
       /// </summary>
-      _GFCLI_CACHEABLEHASHSET_DEF_GENERIC(CacheableLinkedHashSet,
-                                          apache::geode::client::CacheableLinkedHashSet);
+      public ref class CacheableLinkedHashSet : public Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::CacheableLinkedHashSet), apache::geode::client::CacheableLinkedHashSet> { public: inline CacheableLinkedHashSet() : Internal::CacheableHashSetType<static_cast<int8_t>(native::internal::DSCode::CacheableLinkedHashSet), apache::geode::client::CacheableLinkedHashSet>() {} inline CacheableLinkedHashSet(System::Int32 size) : Internal::CacheableHashSetType<static_ [...]
     }  // namespace Client
   }  // namespace Geode
 }  // namespace Apache

[geode-native] 03/05: GEODE-9559: Demacroize _GFCLI_CACHEABLE_KEY_DEF_NEW

Posted by mm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch GEODE-9559-demacroize-clicache
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit 6f61439c258d8458fca331e439e46b3b29fde5ce
Author: Mike Martell <mm...@pivotal.io>
AuthorDate: Sat Aug 28 13:09:27 2021 -0700

    GEODE-9559: Demacroize _GFCLI_CACHEABLE_KEY_DEF_NEW
---
 clicache/src/CacheableBuiltins.hpp | 91 ++++----------------------------------
 1 file changed, 9 insertions(+), 82 deletions(-)

diff --git a/clicache/src/CacheableBuiltins.hpp b/clicache/src/CacheableBuiltins.hpp
index 94bcf0e..b93968f 100644
--- a/clicache/src/CacheableBuiltins.hpp
+++ b/clicache/src/CacheableBuiltins.hpp
@@ -356,129 +356,56 @@ namespace Apache
         }
       };
 
-
-
-
-      //n = native type
-      //m = CacheableInt(managed cacheable)
-      //mt = managed type(bool, int)
-#define _GFCLI_CACHEABLE_KEY_DEF_NEW(n, m, mt)                                   \
-      ref class m : public CacheableBuiltinKey<n, mt,        \
-        static_cast<int8_t>(DSCode::m)>                                                   \
-      {                                                                       \
-      public:                                                                 \
-         /** <summary>
-         *  Allocates a new instance with the given value.
-         *  </summary>
-         *  <param name="value">the value of the new instance</param>
-         */                                                                   \
-         inline m()                                                            \
-         : CacheableBuiltinKey() { }                                         \
-         /** <summary>
-          *  Allocates a new instance with the given value.
-          *  </summary>
-          *  <param name="value">the value of the new instance</param>
-          */                                                                   \
-          inline m(mt value)                                                    \
-          : CacheableBuiltinKey(value) { }                                    \
-          /** <summary>
-           *  Static function to create a new instance given value.
-           *  </summary>
-           *  <param name="value">the value of the new instance</param>
-           */                                                                   \
-           inline static m^ Create(mt value)                                     \
-           {                                                                     \
-           return gcnew m(value);                                              \
-           }                                                                     \
-           /** <summary>
-            * Explicit conversion operator to contained value type.
-            * </summary>
-            */                                                                   \
-            inline static explicit operator mt (m^ value)                         \
-           {                                                                     \
-           return value->Value;                                                \
-           }                                                                     \
-           \
-           /** <summary>
-            * Factory function to register this class.
-            * </summary>
-            */                                                                   \
-            static ISerializable^ CreateDeserializable()                        \
-           {                                                                     \
-           return gcnew m();                                       \
-           }                                                                     \
-           \
-           internal:                                                               \
-           static ISerializable^ Create(std::shared_ptr<native::Serializable> obj)            \
-           {                                                                     \
-           return (obj != nullptr ? gcnew m(obj) : nullptr);                   \
-           }                                                                     \
-           \
-           private:                                                                \
-             inline m(std::shared_ptr<native::Serializable> nativeptr)                            \
-              : CacheableBuiltinKey(nativeptr) { }                                \
-      };
-
-
-
-
       // Built-in CacheableKeys
 
       /// <summary>
       /// An immutable wrapper for booleans that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableBoolean,
-                                   CacheableBoolean, bool);
+      ref class CacheableBoolean : public CacheableBuiltinKey<native::CacheableBoolean, bool, static_cast<int8_t>(DSCode::CacheableBoolean)> { public: inline CacheableBoolean() : CacheableBuiltinKey() { } inline CacheableBoolean(bool value) : CacheableBuiltinKey(value) { } inline static CacheableBoolean^ Create(bool value) { return gcnew CacheableBoolean(value); } inline static explicit operator bool (CacheableBoolean^ value) { return value->Value; } static ISerializable^ CreateDeseriali [...]
 
       /// <summary>
       /// An immutable wrapper for bytes that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableByte,
-                                   CacheableByte, Byte);
+      ref class CacheableByte : public CacheableBuiltinKey<native::CacheableByte, Byte, static_cast<int8_t>(DSCode::CacheableByte)> { public: inline CacheableByte() : CacheableBuiltinKey() { } inline CacheableByte(Byte value) : CacheableBuiltinKey(value) { } inline static CacheableByte^ Create(Byte value) { return gcnew CacheableByte(value); } inline static explicit operator Byte (CacheableByte^ value) { return value->Value; } static ISerializable^ CreateDeserializable() { return gcnew C [...]
 
       /// <summary>
       /// An immutable wrapper for 16-bit characters that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableCharacter,
-                                   CacheableCharacter, Char);
+      ref class CacheableCharacter : public CacheableBuiltinKey<native::CacheableCharacter, Char, static_cast<int8_t>(DSCode::CacheableCharacter)> { public: inline CacheableCharacter() : CacheableBuiltinKey() { } inline CacheableCharacter(Char value) : CacheableBuiltinKey(value) { } inline static CacheableCharacter^ Create(Char value) { return gcnew CacheableCharacter(value); } inline static explicit operator Char (CacheableCharacter^ value) { return value->Value; } static ISerializable^ [...]
 
       /// <summary>
       /// An immutable wrapper for doubles that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableDouble,
-                                   CacheableDouble, Double);
+      ref class CacheableDouble : public CacheableBuiltinKey<native::CacheableDouble, Double, static_cast<int8_t>(DSCode::CacheableDouble)> { public: inline CacheableDouble() : CacheableBuiltinKey() { } inline CacheableDouble(Double value) : CacheableBuiltinKey(value) { } inline static CacheableDouble^ Create(Double value) { return gcnew CacheableDouble(value); } inline static explicit operator Double (CacheableDouble^ value) { return value->Value; } static ISerializable^ CreateDeseriali [...]
 
       /// <summary>
       /// An immutable wrapper for floats that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableFloat,
-                                   CacheableFloat, Single);
+      ref class CacheableFloat : public CacheableBuiltinKey<native::CacheableFloat, Single, static_cast<int8_t>(DSCode::CacheableFloat)> { public: inline CacheableFloat() : CacheableBuiltinKey() { } inline CacheableFloat(Single value) : CacheableBuiltinKey(value) { } inline static CacheableFloat^ Create(Single value) { return gcnew CacheableFloat(value); } inline static explicit operator Single (CacheableFloat^ value) { return value->Value; } static ISerializable^ CreateDeserializable()  [...]
 
       /// <summary>
       /// An immutable wrapper for 16-bit integers that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableInt16,
-                                   CacheableInt16, System::Int16);
+      ref class CacheableInt16 : public CacheableBuiltinKey<native::CacheableInt16, System::Int16, static_cast<int8_t>(DSCode::CacheableInt16)> { public: inline CacheableInt16() : CacheableBuiltinKey() { } inline CacheableInt16(System::Int16 value) : CacheableBuiltinKey(value) { } inline static CacheableInt16^ Create(System::Int16 value) { return gcnew CacheableInt16(value); } inline static explicit operator System::Int16 (CacheableInt16^ value) { return value->Value; } static ISerializa [...]
 
       /// <summary>
       /// An immutable wrapper for 32-bit integers that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableInt32,
-                                   CacheableInt32, System::Int32);
+      ref class CacheableInt32 : public CacheableBuiltinKey<native::CacheableInt32, System::Int32, static_cast<int8_t>(DSCode::CacheableInt32)> { public: inline CacheableInt32() : CacheableBuiltinKey() { } inline CacheableInt32(System::Int32 value) : CacheableBuiltinKey(value) { } inline static CacheableInt32^ Create(System::Int32 value) { return gcnew CacheableInt32(value); } inline static explicit operator System::Int32 (CacheableInt32^ value) { return value->Value; } static ISerializa [...]
 
       /// <summary>
       /// An immutable wrapper for 64-bit integers that can serve
       /// as a distributable key object for caching.
       /// </summary>
-      _GFCLI_CACHEABLE_KEY_DEF_NEW(native::CacheableInt64,
-                                   CacheableInt64, System::Int64);
+      ref class CacheableInt64 : public CacheableBuiltinKey<native::CacheableInt64, System::Int64, static_cast<int8_t>(DSCode::CacheableInt64)> { public: inline CacheableInt64() : CacheableBuiltinKey() { } inline CacheableInt64(System::Int64 value) : CacheableBuiltinKey(value) { } inline static CacheableInt64^ Create(System::Int64 value) { return gcnew CacheableInt64(value); } inline static explicit operator System::Int64 (CacheableInt64^ value) { return value->Value; } static ISerializa [...]
+
 
 
       // Built-in Cacheable array types