| 
      
      
      From: <asf...@us...> - 2014-11-10 14:45:54
      
     | 
| Revision: 60186
          http://sourceforge.net/p/firebird/code/60186
Author:   asfernandes
Date:     2014-11-10 14:45:40 +0000 (Mon, 10 Nov 2014)
Log Message:
-----------
Get rid of upgradeInterface API method and some adjustments. To be continued.
Modified Paths:
--------------
    firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp
    firebird/trunk/examples/dbcrypt/DbCrypt.cpp
    firebird/trunk/examples/udr/UdrCppExample.cpp
    firebird/trunk/lang_helpers/gds_codes.ftn
    firebird/trunk/lang_helpers/gds_codes.pas
    firebird/trunk/src/common/classes/GetPlugins.h
    firebird/trunk/src/common/classes/ImplementHelper.cpp
    firebird/trunk/src/common/fb_exception.cpp
    firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp
    firebird/trunk/src/include/firebird/FirebirdInterface.idl
    firebird/trunk/src/include/firebird/IdlFbInterfaces.h
    firebird/trunk/src/include/firebird/Interface.h
    firebird/trunk/src/include/firebird/UdrCppEngine.h
    firebird/trunk/src/include/gen/codetext.h
    firebird/trunk/src/include/gen/iberror.h
    firebird/trunk/src/include/gen/msgs.h
    firebird/trunk/src/include/gen/sql_code.h
    firebird/trunk/src/include/gen/sql_state.h
    firebird/trunk/src/include/ibase.h
    firebird/trunk/src/jrd/CryptoManager.cpp
    firebird/trunk/src/jrd/ExtEngineManager.cpp
    firebird/trunk/src/jrd/ExtEngineManager.h
    firebird/trunk/src/msgs/facilities2.sql
    firebird/trunk/src/msgs/messages2.sql
    firebird/trunk/src/msgs/system_errors2.sql
    firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp
    firebird/trunk/src/yvalve/MasterImplementation.cpp
    firebird/trunk/src/yvalve/MasterImplementation.h
    firebird/trunk/src/yvalve/PluginManager.cpp
    firebird/trunk/src/yvalve/PluginManager.h
Modified: firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp	2014-11-10 14:45:40 UTC (rev 60186)
@@ -24,6 +24,7 @@
  *  Contributor(s): ______________________________________.
  */
 
+#include "firebird.h"	//// FIXME:
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
Modified: firebird/trunk/examples/dbcrypt/DbCrypt.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/DbCrypt.cpp	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/examples/dbcrypt/DbCrypt.cpp	2014-11-10 14:45:40 UTC (rev 60186)
@@ -24,6 +24,7 @@
  *  Contributor(s): ______________________________________.
  */
 
+#include "firebird.h"	//// FIXME:
 #include <stdint.h>
 
 #include "ibase.h"
Modified: firebird/trunk/examples/udr/UdrCppExample.cpp
===================================================================
--- firebird/trunk/examples/udr/UdrCppExample.cpp	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/examples/udr/UdrCppExample.cpp	2014-11-10 14:45:40 UTC (rev 60186)
@@ -21,6 +21,7 @@
  */
 
 #include "ibase.h"
+#include "firebird.h"	//// FIXME:
 #include "firebird/UdrCppEngine.h"
 #include <assert.h>
 #include <stdio.h>
Modified: firebird/trunk/lang_helpers/gds_codes.ftn
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.ftn	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/lang_helpers/gds_codes.ftn	2014-11-10 14:45:40 UTC (rev 60186)
@@ -1610,6 +1610,8 @@
       PARAMETER (GDS__crdb_nodb                        = 335545098)
       INTEGER*4 GDS__crdb_notable                    
       PARAMETER (GDS__crdb_notable                     = 335545099)
+      INTEGER*4 GDS__interface_version_too_old       
+      PARAMETER (GDS__interface_version_too_old        = 335545100)
       INTEGER*4 GDS__gfix_db_name                    
       PARAMETER (GDS__gfix_db_name                     = 335740929)
       INTEGER*4 GDS__gfix_invalid_sw                 
Modified: firebird/trunk/lang_helpers/gds_codes.pas
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.pas	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/lang_helpers/gds_codes.pas	2014-11-10 14:45:40 UTC (rev 60186)
@@ -812,6 +812,7 @@
 	gds_crdb_load                        = 335545097;
 	gds_crdb_nodb                        = 335545098;
 	gds_crdb_notable                     = 335545099;
+	gds_interface_version_too_old        = 335545100;
 	gds_gfix_db_name                     = 335740929;
 	gds_gfix_invalid_sw                  = 335740930;
 	gds_gfix_incmp_sw                    = 335740932;
Modified: firebird/trunk/src/common/classes/GetPlugins.h
===================================================================
--- firebird/trunk/src/common/classes/GetPlugins.h	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/src/common/classes/GetPlugins.h	2014-11-10 14:45:40 UTC (rev 60186)
@@ -47,7 +47,7 @@
 		LocalStatus status;
 		pluginSet.assignRefNoIncr(pluginInterface->getPlugins(&status, interfaceType,
 			(namesList ? namesList : Config::getDefaultConfig()->getPlugins(interfaceType)),
-			P::VERSION, getUnloadDetector(), NULL));
+			NULL));
 		check(&status);
 
 		getPlugin();
@@ -61,7 +61,7 @@
 		LocalStatus status;
 		pluginSet.assignRefNoIncr(pluginInterface->getPlugins(&status, interfaceType,
 			(namesList ? namesList : knownConfig->getPlugins(interfaceType)),
-			P::VERSION, getUnloadDetector(), new FirebirdConf(knownConfig)));
+			new FirebirdConf(knownConfig)));
 		check(&status);
 
 		getPlugin();
Modified: firebird/trunk/src/common/classes/ImplementHelper.cpp
===================================================================
--- firebird/trunk/src/common/classes/ImplementHelper.cpp	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/src/common/classes/ImplementHelper.cpp	2014-11-10 14:45:40 UTC (rev 60186)
@@ -72,22 +72,6 @@
 }
 
 
-void upgradeInterface(FirebirdApi<FirebirdPolicy>::Versioned* toUpgrade, int desiredVersion, void* function)
-{
-	MasterInterfacePtr()->upgradeInterface(toUpgrade, desiredVersion, getPluginModule(), function);
-}
-
-void logOldPlugin()
-{
-	gds__log("Old version of trace plugin is used - new types of events are ignored");
-}
-
-ISC_STATUS* getUpgradeError()
-{
-	static ISC_STATUS failure[2] = {isc_arg_gds, isc_wish_list};
-	return failure;
-}
-
 #ifdef NOT_USED_OR_REPLACED
 class IDebug
 {
Modified: firebird/trunk/src/common/fb_exception.cpp
===================================================================
--- firebird/trunk/src/common/fb_exception.cpp	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/src/common/fb_exception.cpp	2014-11-10 14:45:40 UTC (rev 60186)
@@ -293,9 +293,4 @@
 	throw fatal_exception(buffer);
 }
 
-void raiseVersionError()
-{
-	fatal_exception::raise("Interface version too old");
-}
-
 }	// namespace Firebird
Modified: firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp
===================================================================
--- firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp	2014-11-10 14:45:40 UTC (rev 60186)
@@ -711,13 +711,6 @@
 		return NULL;
 	}
 
-	int upgradeInterface(IVersioned* /*toUpgrade*/, int /*desiredVersion*/,
-		IPluginModule* /*destMod*/, void* /*function*/)
-	{
-		fb_assert(false);
-		return 0;
-	}
-
 	const char* circularAlloc(const char* s, unsigned len, intptr_t /*thr*/)
 	{
 		char* buf = (char*) malloc(len + 1);
Modified: firebird/trunk/src/include/firebird/FirebirdInterface.idl
===================================================================
--- firebird/trunk/src/include/firebird/FirebirdInterface.idl	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/src/include/firebird/FirebirdInterface.idl	2014-11-10 14:45:40 UTC (rev 60186)
@@ -57,7 +57,7 @@
 	const uint FB_HAS_WARNINGS	= 0x01;
 	const uint FB_HAS_ERRORS 	= 0x02;
 
-	// completion codes - not used in IStatus, but I must have them somewhere
+	// completion codes - not used in Status, but I must have them somewhere
 	const int FB_ERROR = -1;
 	const int FB_OK = 0;
 	const int FB_EOF = 1;
@@ -81,8 +81,6 @@
 	Status getStatus();
 	Provider getDispatcher();
 	PluginManager getPluginManager();
-	int upgradeInterface(Versioned toUpgrade, int desiredVersion,
-		PluginModule destModule, void* function);
 	const string circularAlloc(const string s, uint len, intptr thr);
 	TimerControl getTimerControl();
 	Dtc getDtc();
@@ -90,7 +88,7 @@
 	Transaction registerTransaction(Attachment attachment, Transaction transaction);
 
 	// This function is required to compare interfaces based on vtables of them
-	int same(Versioned first, Versioned second);
+	int same(Versioned first, Versioned second);	//// FIXME: Should we really publish this API?
 
 	MetadataBuilder getMetadataBuilder(Status status, uint fieldCount);
 	//// FIXME: Debug getDebug();
@@ -248,13 +246,11 @@
 	// Main function called to access plugins registered in plugins manager
 	// Has front-end in GetPlugins.h - template GetPlugins
 	// In namesList parameter comma or space separated list of names of configured plugins is passed
-	// PluginModule is a module from which interface is upgraded
 	// in case when plugin's version is less than desired
 	// If caller already has an interface for firebird.conf, it may be passed here
 	// If parameter is missing, plugins will get access to default (non database specific) config
 	PluginSet getPlugins(Status status, uint pluginType,
-						const string namesList, int desiredVersion,
-						PluginModule destModule, FirebirdConf firebirdConf);
+						const string namesList, FirebirdConf firebirdConf);
 	// Get generic config interface for given file
 	Config getConfig(Status status, const string filename);
 	// Plugins must be released using this function - use of plugin's release()
@@ -281,7 +277,7 @@
 // Generic access to all config interfaces
 interface ConfigManager : Versioned
 {
-	// Codes for IConfigManager::getDirectory()
+	// Codes for ConfigManager::getDirectory()
 	const uint FB_DIR_BIN = 0;
 	const uint FB_DIR_SBIN = 1;
 	const uint FB_DIR_CONF = 2;
@@ -323,8 +319,10 @@
 	void getInfo(Status status,
 						 uint itemsLength, const uchar* items,
 						 uint bufferLength, uchar* buffer);
-	int getSegment(Status status, uint bufferLength,
-								   void* buffer, uint* segmentLength);
+
+	[notImplemented(Status::FB_ERROR)]
+	int getSegment(Status status, uint bufferLength, void* buffer, uint* segmentLength);
+
 	void putSegment(Status status, uint length,
 									const void* buffer);
 	void cancel(Status status);
@@ -387,12 +385,12 @@
 
 interface ResultSet : ReferenceCounted
 {
-	int fetchNext(Status status, void* message);
-	int fetchPrior(Status status, void* message);
-	int fetchFirst(Status status, void* message);
-	int fetchLast(Status status, void* message);
-	int fetchAbsolute(Status status, uint position, void* message);
-	int fetchRelative(Status status, int offset, void* message);
+	[notImplemented(Status::FB_ERROR)] int fetchNext(Status status, void* message);
+	[notImplemented(Status::FB_ERROR)] int fetchPrior(Status status, void* message);
+	[notImplemented(Status::FB_ERROR)] int fetchFirst(Status status, void* message);
+	[notImplemented(Status::FB_ERROR)] int fetchLast(Status status, void* message);
+	[notImplemented(Status::FB_ERROR)] int fetchAbsolute(Status status, uint position, void* message);
+	[notImplemented(Status::FB_ERROR)] int fetchRelative(Status status, int offset, void* message);
 	boolean isEof(Status status);
 	boolean isBof(Status status);
 	MessageMetadata getMetadata(Status status);
@@ -591,12 +589,14 @@
 // server part of authentication plugin
 interface Server : Auth
 {
+	[notImplemented(Auth::AUTH_FAILED)]
 	int authenticate(Status status, ServerBlock sBlock, Writer writerInterface);
 }
 
 // .. and corresponding client
 interface Client : Auth
 {
+	[notImplemented(Auth::AUTH_FAILED)]
 	int authenticate(Status status, ClientBlock cBlock);
 }
 
@@ -715,7 +715,7 @@
 	// It's supposed that crypt plugin will invoke keyHandle() function from them
 	// to access callback interface for getting actual crypt key.
 	// If crypt plugin fails to find appropriate key in sources, it should raise error.
-	void setKey(Status status, uint length, KeyHolderPlugin* sources);		// Adriano - this is really ptr to ptr, a set of plugins is passed
+	void setKey(Status status, uint length, KeyHolderPlugin* sources);
 	void encrypt(Status status, uint length, const void* from, void* to);
 	void decrypt(Status status, uint length, const void* from, void* to);
 }
@@ -1080,63 +1080,103 @@
 	// Events supported:
 
 	// Create/close attachment
+
+	[notImplemented(true)]
 	boolean trace_attach(TraceDatabaseConnection connection, boolean create_db, uint att_result);
+
+	[notImplemented(true)]
 	boolean trace_detach(TraceDatabaseConnection connection, boolean drop_db);
 
 	// Start/end transaction
+
+	[notImplemented(true)]
 	boolean trace_transaction_start(TraceDatabaseConnection connection, TraceTransaction transaction,
 			uint tpb_length, const uchar* tpb, uint tra_result);
+
+	[notImplemented(true)]
 	boolean trace_transaction_end(TraceDatabaseConnection connection, TraceTransaction transaction,
 			boolean commit, boolean retain_context, uint tra_result);
 
 	// Stored procedures and triggers execution
+
+	[notImplemented(true)]
 	boolean trace_proc_execute (TraceDatabaseConnection connection, TraceTransaction transaction, TraceProcedure procedure,
 			boolean started, uint proc_result);
+
+	[notImplemented(true)]
 	boolean trace_trigger_execute(TraceDatabaseConnection connection, TraceTransaction transaction, TraceTrigger trigger,
 			boolean started, uint trig_result);
 
 	// Assignment to context variables
+
+	[notImplemented(true)]
 	boolean trace_set_context(TraceDatabaseConnection connection, TraceTransaction transaction, TraceContextVariable variable);
 
 	// DSQL statement lifecycle
+
+	[notImplemented(true)]
 	boolean trace_dsql_prepare(TraceDatabaseConnection connection, TraceTransaction transaction,
 			TraceSQLStatement statement, int64 time_millis, uint req_result);
+
+	[notImplemented(true)]
 	boolean trace_dsql_free(TraceDatabaseConnection connection, TraceSQLStatement statement, uint option);
+
+	[notImplemented(true)]
 	boolean trace_dsql_execute(TraceDatabaseConnection connection, TraceTransaction transaction, TraceSQLStatement statement,
 			boolean started, uint req_result);
 
 	// BLR requests
+
+	[notImplemented(true)]
 	boolean trace_blr_compile(TraceDatabaseConnection connection, TraceTransaction transaction,
 			TraceBLRStatement statement, int64 time_millis, uint req_result);
+
+	[notImplemented(true)]
 	boolean trace_blr_execute(TraceDatabaseConnection connection, TraceTransaction transaction,
 			TraceBLRStatement statement, uint req_result);
 
 	// DYN requests
+
+	[notImplemented(true)]
 	boolean trace_dyn_execute(TraceDatabaseConnection connection, TraceTransaction transaction,
 			TraceDYNRequest request, int64 time_millis, uint req_result);
 
 	// Using the services
+
+	[notImplemented(true)]
 	boolean trace_service_attach(TraceServiceConnection service, uint att_result);
+
+	[notImplemented(true)]
 	boolean trace_service_start(TraceServiceConnection service, uint switches_length, const string switches,
 			uint start_result);
+
+	[notImplemented(true)]
 	boolean trace_service_query(TraceServiceConnection service, uint send_item_length,
 			const uchar* send_items, uint recv_item_length,
 			const uchar* recv_items, uint query_result);
+
+	[notImplemented(true)]
 	boolean trace_service_detach(TraceServiceConnection service, uint detach_result);
 
 	// Errors happened
+
+	[notImplemented(true)]
 	boolean trace_event_error(TraceConnection connection, TraceStatusVector status, const string function);
 
 	// Sweep activity
+
 	const uint SWEEP_STATE_STARTED = 1;
 	const uint SWEEP_STATE_FINISHED = 2;
 	const uint SWEEP_STATE_FAILED = 3;
 	const uint SWEEP_STATE_PROGRESS = 4;
 
+	[notImplemented(true)]
 	boolean trace_event_sweep(TraceDatabaseConnection connection, TraceSweepInfo sweep,
 			uint sweep_state);
 
 	// Stored functions execution
+
+	[notImplemented(true)]
 	boolean trace_func_execute (TraceDatabaseConnection connection, TraceTransaction transaction, TraceFunction function,
 			boolean started, uint func_result);
 }
Modified: firebird/trunk/src/include/firebird/IdlFbInterfaces.h
===================================================================
--- firebird/trunk/src/include/firebird/IdlFbInterfaces.h	2014-11-10 09:32:08 UTC (rev 60185)
+++ firebird/trunk/src/include/firebird/IdlFbInterfaces.h	2014-11-10 14:45:40 UTC (rev 60186)
@@ -130,12 +130,11 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 1;
+		static const unsigned VERSION = 1;
 
 		PluginModule* getModule()
 		{
-			Policy::template checkVersion<1>(this);
-			PluginModule* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getModule(this));
+			PluginModule* ret = static_cast<VTable*>(this->cloopVTable)->getModule(this);
 			return ret;
 		}
 	};
@@ -160,17 +159,15 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 3;
+		static const unsigned VERSION = 2;
 
 		void addRef()
 		{
-			Policy::template checkVersion<2>(this);
 			static_cast<VTable*>(this->cloopVTable)->addRef(this);
 		}
 
 		int release()
 		{
-			Policy::template checkVersion<3>(this);
 			int ret = static_cast<VTable*>(this->cloopVTable)->release(this);
 			return ret;
 		}
@@ -195,11 +192,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 2;
+		static const unsigned VERSION = 2;
 
 		void dispose()
 		{
-			Policy::template checkVersion<2>(this);
 			static_cast<VTable*>(this->cloopVTable)->dispose(this);
 		}
 	};
@@ -230,7 +226,7 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 10;
+		static const unsigned VERSION = 3;
 
 		static const unsigned FB_HAS_WARNINGS = 1;
 		static const unsigned FB_HAS_ERRORS = 2;
@@ -241,51 +237,43 @@
 
 		void init()
 		{
-			Policy::template checkVersion<2>(this);
 			static_cast<VTable*>(this->cloopVTable)->init(this);
 		}
 
 		unsigned getStatus() const
 		{
-			Policy::template checkVersion<3>(this);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getStatus(this);
 			return ret;
 		}
 
 		void setErrors2(unsigned length, const intptr_t* value)
 		{
-			Policy::template checkVersion<4>(this);
 			static_cast<VTable*>(this->cloopVTable)->setErrors2(this, length, value);
 		}
 
 		void setWarnings2(unsigned length, const intptr_t* value)
 		{
-			Policy::template checkVersion<5>(this);
 			static_cast<VTable*>(this->cloopVTable)->setWarnings2(this, length, value);
 		}
 
 		void setErrors(const intptr_t* value)
 		{
-			Policy::template checkVersion<6>(this);
 			static_cast<VTable*>(this->cloopVTable)->setErrors(this, value);
 		}
 
 		void setWarnings(const intptr_t* value)
 		{
-			Policy::template checkVersion<7>(this);
 			static_cast<VTable*>(this->cloopVTable)->setWarnings(this, value);
 		}
 
 		const intptr_t* getErrors() const
 		{
-			Policy::template checkVersion<8>(this);
 			const intptr_t* ret = static_cast<VTable*>(this->cloopVTable)->getErrors(this);
 			return ret;
 		}
 
 		const intptr_t* getWarnings() const
 		{
-			Policy::template checkVersion<9>(this);
 			const intptr_t* ret = static_cast<VTable*>(this->cloopVTable)->getWarnings(this);
 			return ret;
 		}
@@ -299,7 +287,6 @@
 			Status* (CLOOP_CARG *getStatus)(Master* self) throw();
 			Provider* (CLOOP_CARG *getDispatcher)(Master* self) throw();
 			PluginManager* (CLOOP_CARG *getPluginManager)(Master* self) throw();
-			int (CLOOP_CARG *upgradeInterface)(Master* self, Versioned* toUpgrade, int desiredVersion, PluginModule* destModule, void* function) throw();
 			const char* (CLOOP_CARG *circularAlloc)(Master* self, const char* s, unsigned len, intptr_t thr) throw();
 			TimerControl* (CLOOP_CARG *getTimerControl)(Master* self) throw();
 			Dtc* (CLOOP_CARG *getDtc)(Master* self) throw();
@@ -323,105 +310,85 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 15;
+		static const unsigned VERSION = 2;
 
 		Status* getStatus()
 		{
-			Policy::template checkVersion<2>(this);
-			Status* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getStatus(this));
+			Status* ret = static_cast<VTable*>(this->cloopVTable)->getStatus(this);
 			return ret;
 		}
 
 		Provider* getDispatcher()
 		{
-			Policy::template checkVersion<3>(this);
-			Provider* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getDispatcher(this));
+			Provider* ret = static_cast<VTable*>(this->cloopVTable)->getDispatcher(this);
 			return ret;
 		}
 
 		PluginManager* getPluginManager()
 		{
-			Policy::template checkVersion<4>(this);
-			PluginManager* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getPluginManager(this));
+			PluginManager* ret = static_cast<VTable*>(this->cloopVTable)->getPluginManager(this);
 			return ret;
 		}
 
-		int upgradeInterface(Versioned* toUpgrade, int desiredVersion, PluginModule* destModule, void* function)
-		{
-			Policy::template checkVersion<5>(this);
-			int ret = static_cast<VTable*>(this->cloopVTable)->upgradeInterface(this, toUpgrade, desiredVersion, destModule, function);
-			return ret;
-		}
-
 		const char* circularAlloc(const char* s, unsigned len, intptr_t thr)
 		{
-			Policy::template checkVersion<6>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->circularAlloc(this, s, len, thr);
 			return ret;
 		}
 
 		TimerControl* getTimerControl()
 		{
-			Policy::template checkVersion<7>(this);
-			TimerControl* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getTimerControl(this));
+			TimerControl* ret = static_cast<VTable*>(this->cloopVTable)->getTimerControl(this);
 			return ret;
 		}
 
 		Dtc* getDtc()
 		{
-			Policy::template checkVersion<8>(this);
-			Dtc* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getDtc(this));
+			Dtc* ret = static_cast<VTable*>(this->cloopVTable)->getDtc(this);
 			return ret;
 		}
 
 		Attachment* registerAttachment(Provider* provider, Attachment* attachment)
 		{
-			Policy::template checkVersion<9>(this);
-			Attachment* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->registerAttachment(this, provider, attachment));
+			Attachment* ret = static_cast<VTable*>(this->cloopVTable)->registerAttachment(this, provider, attachment);
 			return ret;
 		}
 
 		Transaction* registerTransaction(Attachment* attachment, Transaction* transaction)
 		{
-			Policy::template checkVersion<10>(this);
-			Transaction* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->registerTransaction(this, attachment, transaction));
+			Transaction* ret = static_cast<VTable*>(this->cloopVTable)->registerTransaction(this, attachment, transaction);
 			return ret;
 		}
 
 		int same(Versioned* first, Versioned* second)
 		{
-			Policy::template checkVersion<11>(this);
 			int ret = static_cast<VTable*>(this->cloopVTable)->same(this, first, second);
 			return ret;
 		}
 
 		MetadataBuilder* getMetadataBuilder(Status* status, unsigned fieldCount)
 		{
-			Policy::template checkVersion<12>(this);
 			typename Policy::Status status2(status);
-			MetadataBuilder* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getMetadataBuilder(this, status2, fieldCount));
+			MetadataBuilder* ret = static_cast<VTable*>(this->cloopVTable)->getMetadataBuilder(this, status2, fieldCount);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		int serverMode(int mode)
 		{
-			Policy::template checkVersion<13>(this);
 			int ret = static_cast<VTable*>(this->cloopVTable)->serverMode(this, mode);
 			return ret;
 		}
 
 		Utl* getUtlInterface()
 		{
-			Policy::template checkVersion<14>(this);
-			Utl* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getUtlInterface(this));
+			Utl* ret = static_cast<VTable*>(this->cloopVTable)->getUtlInterface(this);
 			return ret;
 		}
 
 		ConfigManager* getConfigManager()
 		{
-			Policy::template checkVersion<15>(this);
-			ConfigManager* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getConfigManager(this));
+			ConfigManager* ret = static_cast<VTable*>(this->cloopVTable)->getConfigManager(this);
 			return ret;
 		}
 	};
@@ -446,18 +413,16 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 5;
+		static const unsigned VERSION = 3;
 
 		void setOwner(ReferenceCounted* r)
 		{
-			Policy::template checkVersion<3>(this);
 			static_cast<VTable*>(this->cloopVTable)->setOwner(this, r);
 		}
 
 		ReferenceCounted* getOwner()
 		{
-			Policy::template checkVersion<4>(this);
-			ReferenceCounted* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getOwner(this));
+			ReferenceCounted* ret = static_cast<VTable*>(this->cloopVTable)->getOwner(this);
 			return ret;
 		}
 	};
@@ -485,34 +450,30 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 8;
+		static const unsigned VERSION = 3;
 
 		const char* getName() const
 		{
-			Policy::template checkVersion<3>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getName(this);
 			return ret;
 		}
 
 		const char* getModuleName() const
 		{
-			Policy::template checkVersion<4>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getModuleName(this);
 			return ret;
 		}
 
 		PluginBase* getPlugin(Status* status)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
-			PluginBase* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getPlugin(this, status2));
+			PluginBase* ret = static_cast<VTable*>(this->cloopVTable)->getPlugin(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		void next(Status* status)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->next(this, status2);
 			Policy::checkException(status2);
@@ -520,7 +481,6 @@
 
 		void set(Status* status, const char* s)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->set(this, status2, s);
 			Policy::checkException(status2);
@@ -550,41 +510,36 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 8;
+		static const unsigned VERSION = 3;
 
 		const char* getName()
 		{
-			Policy::template checkVersion<3>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getName(this);
 			return ret;
 		}
 
 		const char* getValue()
 		{
-			Policy::template checkVersion<4>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getValue(this);
 			return ret;
 		}
 
 		ISC_INT64 getIntValue()
 		{
-			Policy::template checkVersion<5>(this);
 			ISC_INT64 ret = static_cast<VTable*>(this->cloopVTable)->getIntValue(this);
 			return ret;
 		}
 
 		FB_BOOLEAN getBoolValue()
 		{
-			Policy::template checkVersion<6>(this);
 			FB_BOOLEAN ret = static_cast<VTable*>(this->cloopVTable)->getBoolValue(this);
 			return ret;
 		}
 
 		Config* getSubConfig(Status* status)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
-			Config* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getSubConfig(this, status2));
+			Config* ret = static_cast<VTable*>(this->cloopVTable)->getSubConfig(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
@@ -611,31 +566,28 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 6;
+		static const unsigned VERSION = 3;
 
 		ConfigEntry* find(Status* status, const char* name)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
-			ConfigEntry* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->find(this, status2, name));
+			ConfigEntry* ret = static_cast<VTable*>(this->cloopVTable)->find(this, status2, name);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		ConfigEntry* findValue(Status* status, const char* name, const char* value)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
-			ConfigEntry* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->findValue(this, status2, name, value));
+			ConfigEntry* ret = static_cast<VTable*>(this->cloopVTable)->findValue(this, status2, name, value);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		ConfigEntry* findPos(Status* status, const char* name, unsigned pos)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
-			ConfigEntry* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->findPos(this, status2, name, pos));
+			ConfigEntry* ret = static_cast<VTable*>(this->cloopVTable)->findPos(this, status2, name, pos);
 			Policy::checkException(status2);
 			return ret;
 		}
@@ -663,32 +615,28 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 7;
+		static const unsigned VERSION = 3;
 
 		unsigned getKey(const char* name)
 		{
-			Policy::template checkVersion<3>(this);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getKey(this, name);
 			return ret;
 		}
 
 		ISC_INT64 asInteger(unsigned key)
 		{
-			Policy::template checkVersion<4>(this);
 			ISC_INT64 ret = static_cast<VTable*>(this->cloopVTable)->asInteger(this, key);
 			return ret;
 		}
 
 		const char* asString(unsigned key)
 		{
-			Policy::template checkVersion<5>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->asString(this, key);
 			return ret;
 		}
 
 		FB_BOOLEAN asBoolean(unsigned key)
 		{
-			Policy::template checkVersion<6>(this);
 			FB_BOOLEAN ret = static_cast<VTable*>(this->cloopVTable)->asBoolean(this, key);
 			return ret;
 		}
@@ -716,36 +664,32 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 7;
+		static const unsigned VERSION = 3;
 
 		const char* getConfigFileName()
 		{
-			Policy::template checkVersion<3>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getConfigFileName(this);
 			return ret;
 		}
 
 		Config* getDefaultConfig(Status* status)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
-			Config* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getDefaultConfig(this, status2));
+			Config* ret = static_cast<VTable*>(this->cloopVTable)->getDefaultConfig(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		FirebirdConf* getFirebirdConf(Status* status)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
-			FirebirdConf* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getFirebirdConf(this, status2));
+			FirebirdConf* ret = static_cast<VTable*>(this->cloopVTable)->getFirebirdConf(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		void setReleaseDelay(Status* status, ISC_UINT64 microSeconds)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setReleaseDelay(this, status2, microSeconds);
 			Policy::checkException(status2);
@@ -771,13 +715,12 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 2;
+		static const unsigned VERSION = 2;
 
 		PluginBase* createPlugin(Status* status, PluginConfig* factoryParameter)
 		{
-			Policy::template checkVersion<2>(this);
 			typename Policy::Status status2(status);
-			PluginBase* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->createPlugin(this, status2, factoryParameter));
+			PluginBase* ret = static_cast<VTable*>(this->cloopVTable)->createPlugin(this, status2, factoryParameter);
 			Policy::checkException(status2);
 			return ret;
 		}
@@ -802,11 +745,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 2;
+		static const unsigned VERSION = 2;
 
 		void doClean()
 		{
-			Policy::template checkVersion<2>(this);
 			static_cast<VTable*>(this->cloopVTable)->doClean(this);
 		}
 	};
@@ -819,7 +761,7 @@
 			void (CLOOP_CARG *registerPluginFactory)(PluginManager* self, unsigned pluginType, const char* defaultName, PluginFactory* factory) throw();
 			void (CLOOP_CARG *registerModule)(PluginManager* self, PluginModule* cleanup) throw();
 			void (CLOOP_CARG *unregisterModule)(PluginManager* self, PluginModule* cleanup) throw();
-			PluginSet* (CLOOP_CARG *getPlugins)(PluginManager* self, Status* status, unsigned pluginType, const char* namesList, int desiredVersion, PluginModule* destModule, FirebirdConf* firebirdConf) throw();
+			PluginSet* (CLOOP_CARG *getPlugins)(PluginManager* self, Status* status, unsigned pluginType, const char* namesList, FirebirdConf* firebirdConf) throw();
 			Config* (CLOOP_CARG *getConfig)(PluginManager* self, Status* status, const char* filename) throw();
 			void (CLOOP_CARG *releasePlugin)(PluginManager* self, PluginBase* plugin) throw();
 		};
@@ -835,7 +777,7 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 7;
+		static const unsigned VERSION = 2;
 
 		static const unsigned Provider = 1;
 		static const unsigned FirstNonLibPlugin = 2;
@@ -851,43 +793,37 @@
 
 		void registerPluginFactory(unsigned pluginType, const char* defaultName, PluginFactory* factory)
 		{
-			Policy::template checkVersion<2>(this);
 			static_cast<VTable*>(this->cloopVTable)->registerPluginFactory(this, pluginType, defaultName, factory);
 		}
 
 		void registerModule(PluginModule* cleanup)
 		{
-			Policy::template checkVersion<3>(this);
 			static_cast<VTable*>(this->cloopVTable)->registerModule(this, cleanup);
 		}
 
 		void unregisterModule(PluginModule* cleanup)
 		{
-			Policy::template checkVersion<4>(this);
 			static_cast<VTable*>(this->cloopVTable)->unregisterModule(this, cleanup);
 		}
 
-		PluginSet* getPlugins(Status* status, unsigned pluginType, const char* namesList, int desiredVersion, PluginModule* destModule, FirebirdConf* firebirdConf)
+		PluginSet* getPlugins(Status* status, unsigned pluginType, const char* namesList, FirebirdConf* firebirdConf)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
-			PluginSet* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getPlugins(this, status2, pluginType, namesList, desiredVersion, destModule, firebirdConf));
+			PluginSet* ret = static_cast<VTable*>(this->cloopVTable)->getPlugins(this, status2, pluginType, namesList, firebirdConf);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		Config* getConfig(Status* status, const char* filename)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
-			Config* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getConfig(this, status2, filename));
+			Config* ret = static_cast<VTable*>(this->cloopVTable)->getConfig(this, status2, filename);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		void releasePlugin(PluginBase* plugin)
 		{
-			Policy::template checkVersion<7>(this);
 			static_cast<VTable*>(this->cloopVTable)->releasePlugin(this, plugin);
 		}
 	};
@@ -914,7 +850,7 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 5;
+		static const unsigned VERSION = 2;
 
 		static const unsigned FB_DIR_BIN = 0;
 		static const unsigned FB_DIR_SBIN = 1;
@@ -937,29 +873,25 @@
 
 		const char* getDirectory(unsigned code)
 		{
-			Policy::template checkVersion<2>(this);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getDirectory(this, code);
 			return ret;
 		}
 
 		FirebirdConf* getFirebirdConf()
 		{
-			Policy::template checkVersion<3>(this);
-			FirebirdConf* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getFirebirdConf(this));
+			FirebirdConf* ret = static_cast<VTable*>(this->cloopVTable)->getFirebirdConf(this);
 			return ret;
 		}
 
 		FirebirdConf* getDatabaseConf(const char* dbName)
 		{
-			Policy::template checkVersion<4>(this);
-			FirebirdConf* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getDatabaseConf(this, dbName));
+			FirebirdConf* ret = static_cast<VTable*>(this->cloopVTable)->getDatabaseConf(this, dbName);
 			return ret;
 		}
 
 		Config* getPluginConfig(const char* configuredPlugin)
 		{
-			Policy::template checkVersion<5>(this);
-			Config* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getPluginConfig(this, configuredPlugin));
+			Config* ret = static_cast<VTable*>(this->cloopVTable)->getPluginConfig(this, configuredPlugin);
 			return ret;
 		}
 	};
@@ -983,11 +915,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 4;
+		static const unsigned VERSION = 3;
 
 		void eventCallbackFunction(unsigned length, const unsigned char* events)
 		{
-			Policy::template checkVersion<3>(this);
 			static_cast<VTable*>(this->cloopVTable)->eventCallbackFunction(this, length, events);
 		}
 	};
@@ -1016,11 +947,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 9;
+		static const unsigned VERSION = 3;
 
 		void getInfo(Status* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->getInfo(this, status2, itemsLength, items, bufferLength, buffer);
 			Policy::checkException(status2);
@@ -1028,7 +958,6 @@
 
 		int getSegment(Status* status, unsigned bufferLength, void* buffer, unsigned* segmentLength)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->getSegment(this, status2, bufferLength, buffer, segmentLength);
 			Policy::checkException(status2);
@@ -1037,7 +966,6 @@
 
 		void putSegment(Status* status, unsigned length, const void* buffer)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->putSegment(this, status2, length, buffer);
 			Policy::checkException(status2);
@@ -1045,7 +973,6 @@
 
 		void cancel(Status* status)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->cancel(this, status2);
 			Policy::checkException(status2);
@@ -1053,7 +980,6 @@
 
 		void close(Status* status)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->close(this, status2);
 			Policy::checkException(status2);
@@ -1061,7 +987,6 @@
 
 		int seek(Status* status, int mode, int offset)
 		{
-			Policy::template checkVersion<8>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->seek(this, status2, mode, offset);
 			Policy::checkException(status2);
@@ -1097,11 +1022,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 13;
+		static const unsigned VERSION = 3;
 
 		void getInfo(Status* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->getInfo(this, status2, itemsLength, items, bufferLength, buffer);
 			Policy::checkException(status2);
@@ -1109,7 +1033,6 @@
 
 		void prepare(Status* status, unsigned msgLength, const unsigned char* message)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->prepare(this, status2, msgLength, message);
 			Policy::checkException(status2);
@@ -1117,7 +1040,6 @@
 
 		void commit(Status* status)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->commit(this, status2);
 			Policy::checkException(status2);
@@ -1125,7 +1047,6 @@
 
 		void commitRetaining(Status* status)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->commitRetaining(this, status2);
 			Policy::checkException(status2);
@@ -1133,7 +1054,6 @@
 
 		void rollback(Status* status)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->rollback(this, status2);
 			Policy::checkException(status2);
@@ -1141,7 +1061,6 @@
 
 		void rollbackRetaining(Status* status)
 		{
-			Policy::template checkVersion<8>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->rollbackRetaining(this, status2);
 			Policy::checkException(status2);
@@ -1149,7 +1068,6 @@
 
 		void disconnect(Status* status)
 		{
-			Policy::template checkVersion<9>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->disconnect(this, status2);
 			Policy::checkException(status2);
@@ -1157,27 +1075,24 @@
 
 		Transaction* join(Status* status, Transaction* transaction)
 		{
-			Policy::template checkVersion<10>(this);
 			typename Policy::Status status2(status);
-			Transaction* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->join(this, status2, transaction));
+			Transaction* ret = static_cast<VTable*>(this->cloopVTable)->join(this, status2, transaction);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		Transaction* validate(Status* status, Attachment* attachment)
 		{
-			Policy::template checkVersion<11>(this);
 			typename Policy::Status status2(status);
-			Transaction* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->validate(this, status2, attachment));
+			Transaction* ret = static_cast<VTable*>(this->cloopVTable)->validate(this, status2, attachment);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		Transaction* enterDtc(Status* status)
 		{
-			Policy::template checkVersion<12>(this);
 			typename Policy::Status status2(status);
-			Transaction* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->enterDtc(this, status2));
+			Transaction* ret = static_cast<VTable*>(this->cloopVTable)->enterDtc(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
@@ -1216,11 +1131,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 18;
+		static const unsigned VERSION = 3;
 
 		unsigned getCount(Status* status)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getCount(this, status2);
 			Policy::checkException(status2);
@@ -1229,7 +1143,6 @@
 
 		const char* getField(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getField(this, status2, index);
 			Policy::checkException(status2);
@@ -1238,7 +1151,6 @@
 
 		const char* getRelation(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getRelation(this, status2, index);
 			Policy::checkException(status2);
@@ -1247,7 +1159,6 @@
 
 		const char* getOwner(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getOwner(this, status2, index);
 			Policy::checkException(status2);
@@ -1256,7 +1167,6 @@
 
 		const char* getAlias(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getAlias(this, status2, index);
 			Policy::checkException(status2);
@@ -1265,7 +1175,6 @@
 
 		unsigned getType(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<8>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getType(this, status2, index);
 			Policy::checkException(status2);
@@ -1274,7 +1183,6 @@
 
 		FB_BOOLEAN isNullable(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<9>(this);
 			typename Policy::Status status2(status);
 			FB_BOOLEAN ret = static_cast<VTable*>(this->cloopVTable)->isNullable(this, status2, index);
 			Policy::checkException(status2);
@@ -1283,7 +1191,6 @@
 
 		int getSubType(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<10>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->getSubType(this, status2, index);
 			Policy::checkException(status2);
@@ -1292,7 +1199,6 @@
 
 		unsigned getLength(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<11>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getLength(this, status2, index);
 			Policy::checkException(status2);
@@ -1301,7 +1207,6 @@
 
 		int getScale(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<12>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->getScale(this, status2, index);
 			Policy::checkException(status2);
@@ -1310,7 +1215,6 @@
 
 		unsigned getCharSet(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<13>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getCharSet(this, status2, index);
 			Policy::checkException(status2);
@@ -1319,7 +1223,6 @@
 
 		unsigned getOffset(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<14>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getOffset(this, status2, index);
 			Policy::checkException(status2);
@@ -1328,7 +1231,6 @@
 
 		unsigned getNullOffset(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<15>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getNullOffset(this, status2, index);
 			Policy::checkException(status2);
@@ -1337,16 +1239,14 @@
 
 		MetadataBuilder* getBuilder(Status* status)
 		{
-			Policy::template checkVersion<16>(this);
 			typename Policy::Status status2(status);
-			MetadataBuilder* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getBuilder(this, status2));
+			MetadataBuilder* ret = static_cast<VTable*>(this->cloopVTable)->getBuilder(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		unsigned getMessageLength(Status* status)
 		{
-			Policy::template checkVersion<17>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getMessageLength(this, status2);
 			Policy::checkException(status2);
@@ -1382,11 +1282,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 13;
+		static const unsigned VERSION = 3;
 
 		void setType(Status* status, unsigned index, unsigned type)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setType(this, status2, index, type);
 			Policy::checkException(status2);
@@ -1394,7 +1293,6 @@
 
 		void setSubType(Status* status, unsigned index, int subType)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setSubType(this, status2, index, subType);
 			Policy::checkException(status2);
@@ -1402,7 +1300,6 @@
 
 		void setLength(Status* status, unsigned index, unsigned length)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setLength(this, status2, index, length);
 			Policy::checkException(status2);
@@ -1410,7 +1307,6 @@
 
 		void setCharSet(Status* status, unsigned index, unsigned charSet)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setCharSet(this, status2, index, charSet);
 			Policy::checkException(status2);
@@ -1418,7 +1314,6 @@
 
 		void setScale(Status* status, unsigned index, unsigned scale)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setScale(this, status2, index, scale);
 			Policy::checkException(status2);
@@ -1426,7 +1321,6 @@
 
 		void truncate(Status* status, unsigned count)
 		{
-			Policy::template checkVersion<8>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->truncate(this, status2, count);
 			Policy::checkException(status2);
@@ -1434,7 +1328,6 @@
 
 		void moveNameToIndex(Status* status, const char* name, unsigned index)
 		{
-			Policy::template checkVersion<9>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->moveNameToIndex(this, status2, name, index);
 			Policy::checkException(status2);
@@ -1442,7 +1335,6 @@
 
 		void remove(Status* status, unsigned index)
 		{
-			Policy::template checkVersion<10>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->remove(this, status2, index);
 			Policy::checkException(status2);
@@ -1450,7 +1342,6 @@
 
 		unsigned addField(Status* status)
 		{
-			Policy::template checkVersion<11>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->addField(this, status2);
 			Policy::checkException(status2);
@@ -1459,9 +1350,8 @@
 
 		MessageMetadata* getMetadata(Status* status)
 		{
-			Policy::template checkVersion<12>(this);
 			typename Policy::Status status2(status);
-			MessageMetadata* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getMetadata(this, status2));
+			MessageMetadata* ret = static_cast<VTable*>(this->cloopVTable)->getMetadata(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
@@ -1496,11 +1386,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 14;
+		static const unsigned VERSION = 3;
 
 		int fetchNext(Status* status, void* message)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->fetchNext(this, status2, message);
 			Policy::checkException(status2);
@@ -1509,7 +1398,6 @@
 
 		int fetchPrior(Status* status, void* message)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->fetchPrior(this, status2, message);
 			Policy::checkException(status2);
@@ -1518,7 +1406,6 @@
 
 		int fetchFirst(Status* status, void* message)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->fetchFirst(this, status2, message);
 			Policy::checkException(status2);
@@ -1527,7 +1414,6 @@
 
 		int fetchLast(Status* status, void* message)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->fetchLast(this, status2, message);
 			Policy::checkException(status2);
@@ -1536,7 +1422,6 @@
 
 		int fetchAbsolute(Status* status, unsigned position, void* message)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->fetchAbsolute(this, status2, position, message);
 			Policy::checkException(status2);
@@ -1545,7 +1430,6 @@
 
 		int fetchRelative(Status* status, int offset, void* message)
 		{
-			Policy::template checkVersion<8>(this);
 			typename Policy::Status status2(status);
 			int ret = static_cast<VTable*>(this->cloopVTable)->fetchRelative(this, status2, offset, message);
 			Policy::checkException(status2);
@@ -1554,7 +1438,6 @@
 
 		FB_BOOLEAN isEof(Status* status)
 		{
-			Policy::template checkVersion<9>(this);
 			typename Policy::Status status2(status);
 			FB_BOOLEAN ret = static_cast<VTable*>(this->cloopVTable)->isEof(this, status2);
 			Policy::checkException(status2);
@@ -1563,7 +1446,6 @@
 
 		FB_BOOLEAN isBof(Status* status)
 		{
-			Policy::template checkVersion<10>(this);
 			typename Policy::Status status2(status);
 			FB_BOOLEAN ret = static_cast<VTable*>(this->cloopVTable)->isBof(this, status2);
 			Policy::checkException(status2);
@@ -1572,16 +1454,14 @@
 
 		MessageMetadata* getMetadata(Status* status)
 		{
-			Policy::template checkVersion<11>(this);
 			typename Policy::Status status2(status);
-			MessageMetadata* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getMetadata(this, status2));
+			MessageMetadata* ret = static_cast<VTable*>(this->cloopVTable)->getMetadata(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		void close(Status* status)
 		{
-			Policy::template checkVersion<12>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->close(this, status2);
 			Policy::checkException(status2);
@@ -1589,7 +1469,6 @@
 
 		void setDelayedOutputFormat(Status* status, MessageMetadata* format)
 		{
-			Policy::template checkVersion<13>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setDelayedOutputFormat(this, status2, format);
 			Policy::checkException(status2);
@@ -1625,7 +1504,7 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 14;
+		static const unsigned VERSION = 3;
 
 		static const unsigned PREPARE_PREFETCH_NONE = 0;
 		static const unsigned PREPARE_PREFETCH_TYPE = 1;
@@ -1635,14 +1514,13 @@
 		static const unsigned PREPARE_PREFETCH_DETAILED_PLAN = 16;
 		static const unsigned PREPARE_PREFETCH_AFFECTED_RECORDS = 32;
 		static const unsigned PREPARE_PREFETCH_FLAGS = 64;
-		static const unsigned PREPARE_PREFETCH_METADATA = PREPARE_PREFETCH_TYPE | PREPARE_PREFETCH_FLAGS | PREPARE_PREFETCH_INPUT_PARAMETERS | PREPARE_PREFETCH_OUTPUT_PARAMETERS;
-		static const unsigned PREPARE_PREFETCH_ALL = PREPARE_PREFETCH_METADATA | PREPARE_PREFETCH_LEGACY_PLAN | PREPARE_PREFETCH_DETAILED_PLAN | PREPARE_PREFETCH_AFFECTED_RECORDS;
+		static const unsigned PREPARE_PREFETCH_METADATA = Statement::PREPARE_PREFETCH_TYPE | Statement::PREPARE_PREFETCH_FLAGS | Statement::PREPARE_PREFETCH_INPUT_PARAMETERS | Statement::PREPARE_PREFETCH_OUTPUT_PARAMETERS;
+		static const unsigned PREPARE_PREFETCH_ALL = Statement::PREPARE_PREFETCH_METADATA | Statement::PREPARE_PREFETCH_LEGACY_PLAN | Statement::PREPARE_PREFETCH_DETAILED_PLAN | Statement::PREPARE_PREFETCH_AFFECTED_RECORDS;
 		static const unsigned FLAG_HAS_CURSOR = 1;
 		static const unsigned FLAG_REPEAT_EXECUTE = 2;
 
 		void getInfo(Status* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->getInfo(this, status2, itemsLength, items, bufferLength, buffer);
 			Policy::checkException(status2);
@@ -1650,7 +1528,6 @@
 
 		unsigned getType(Status* status)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getType(this, status2);
 			Policy::checkException(status2);
@@ -1659,7 +1536,6 @@
 
 		const char* getPlan(Status* status, FB_BOOLEAN detailed)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			const char* ret = static_cast<VTable*>(this->cloopVTable)->getPlan(this, status2, detailed);
 			Policy::checkException(status2);
@@ -1668,7 +1544,6 @@
 
 		ISC_UINT64 getAffectedRecords(Status* status)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			ISC_UINT64 ret = static_cast<VTable*>(this->cloopVTable)->getAffectedRecords(this, status2);
 			Policy::checkException(status2);
@@ -1677,43 +1552,38 @@
 
 		MessageMetadata* getInputMetadata(Status* status)
 		{
-			Policy::template checkVersion<7>(this);
 			typename Policy::Status status2(status);
-			MessageMetadata* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getInputMetadata(this, status2));
+			MessageMetadata* ret = static_cast<VTable*>(this->cloopVTable)->getInputMetadata(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		MessageMetadata* getOutputMetadata(Status* status)
 		{
-			Policy::template checkVersion<8>(this);
 			typename Policy::Status status2(status);
-			MessageMetadata* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->getOutputMetadata(this, status2));
+			MessageMetadata* ret = static_cast<VTable*>(this->cloopVTable)->getOutputMetadata(this, status2);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		Transaction* execute(Status* status, Transaction* transaction, MessageMetadata* inMetadata, void* inBuffer, MessageMetadata* outMetadata, void* outBuffer)
 		{
-			Policy::template checkVersion<9>(this);
 			typename Policy::Status status2(status);
-			Transaction* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->execute(this, status2, transaction, inMetadata, inBuffer, outMetadata, outBuffer));
+			Transaction* ret = static_cast<VTable*>(this->cloopVTable)->execute(this, status2, transaction, inMetadata, inBuffer, outMetadata, outBuffer);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		ResultSet* openCursor(Status* status, Transaction* transaction, MessageMetadata* inMetadata, void* inBuffer, MessageMetadata* outMetadata)
 		{
-			Policy::template checkVersion<10>(this);
 			typename Policy::Status status2(status);
-			ResultSet* ret = Policy::upgrade(static_cast<VTable*>(this->cloopVTable)->openCursor(this, status2, transaction, inMetadata, inBuffer, outMetadata));
+			ResultSet* ret = static_cast<VTable*>(this->cloopVTable)->openCursor(this, status2, transaction, inMetadata, inBuffer, outMetadata);
 			Policy::checkException(status2);
 			return ret;
 		}
 
 		void setCursorName(Status* status, const char* name)
 		{
-			Policy::template checkVersion<11>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->setCursorName(this, status2, name);
 			Policy::checkException(status2);
@@ -1721,7 +1591,6 @@
 
 		void free(Status* status)
 		{
-			Policy::template checkVersion<12>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->free(this, status2);
 			Policy::checkException(status2);
@@ -1729,7 +1598,6 @@
 
 		unsigned getFlags(Status* status)
 		{
-			Policy::template checkVersion<13>(this);
 			typename Policy::Status status2(status);
 			unsigned ret = static_cast<VTable*>(this->cloopVTable)->getFlags(this, status2);
 			Policy::checkException(status2);
@@ -1762,11 +1630,10 @@
 		}
 
 	public:
-		static const unsigned int VERSION = 10;
+		static const unsigned VERSION = 3;
 
 		void receive(Status* status, int level, unsigned msgType, unsigned length, unsigned char* message)
 		{
-			Policy::template checkVersion<3>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->receive(this, status2, level, msgType, length, message);
 			Policy::checkException(status2);
@@ -1774,7 +1641,6 @@
 
 		void send(Status* status, int level, unsigned msgType, unsigned length, const unsigned char* message)
 		{
-			Policy::template checkVersion<4>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->send(this, status2, level, msgType, length, message);
 			Policy::checkException(status2);
@@ -1782,7 +1648,6 @@
 
 		void getInfo(Status* status, int level, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer)
 		{
-			Policy::template checkVersion<5>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->getInfo(this, status2, level, itemsLength, items, bufferLength, buffer);
 			Policy::checkException(status2);
@@ -1790,7 +1655,6 @@
 
 		void start(Status* status, Transaction* tra, int level)
 		{
-			Policy::template checkVersion<6>(this);
 			typename Policy::Status status2(status);
 			static_cast<VTable*>(this->cloopVTable)->start(this, status2, tra, level);
 			Policy::checkExcep...
 
[truncated message content] |