Sha256: e2b68dc2041d8a93c33c1960500b657cbe5bea3ab51b25a4986d62941e520d56

Contents?: true

Size: 930 Bytes

Versions: 19

Compression:

Stored size: 930 Bytes

Contents

#pragma once

#include "DBAdapter.h"

namespace rho {
namespace db {

class CDBImportTransaction {
	CDBAdapter& _db;
	String _srcZipPath;
	String _stateFileName;
	String _importDirPath;
	String _importZipPath;
	String _backupDirPath;
	String _backupBlobsDirPath;
	String _blobsListPath;
	
	enum enTxnState {
		txnInvalid,
		txnNotStarted, 
		txnPrepareImportData,
		txnEnumerateOldBlobs,
		txnBackupOldDb,
		txnBackupOldBlobs,
		txnImportNewDb,
		txnImportNewBlobs,
		txnCleanup
	};
	
	enTxnState _state;
public:
	DEFINE_LOGCLASS;

	CDBImportTransaction( CDBAdapter& db, const String& zipPath = "" );
	~CDBImportTransaction() {}
	
	bool commit();
	bool rollback();
	bool pending();
	
private:
	void determineTxnState();
	void setTxnState( enTxnState state );
	
	bool prepareImportData();
	bool enumerateOldBlobs();
	bool backupOldDb();
	bool backupOldBlobs();
	bool importNewDb();
	bool importNewBlobs();
	bool cleanup();
};

}

}

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
rhodes-7.6.0 platform/shared/db/DBImportTransaction.h
rhodes-7.5.1 platform/shared/db/DBImportTransaction.h
rhodes-7.4.1 platform/shared/db/DBImportTransaction.h
rhodes-7.1.17 platform/shared/db/DBImportTransaction.h
rhodes-6.2.0 platform/shared/db/DBImportTransaction.h
rhodes-6.0.11 platform/shared/db/DBImportTransaction.h
rhodes-5.5.18 platform/shared/db/DBImportTransaction.h
rhodes-5.5.17 platform/shared/db/DBImportTransaction.h
rhodes-5.5.15 platform/shared/db/DBImportTransaction.h
rhodes-5.5.0.22 platform/shared/db/DBImportTransaction.h
rhodes-5.5.2 platform/shared/db/DBImportTransaction.h
rhodes-5.5.0.7 platform/shared/db/DBImportTransaction.h
rhodes-5.5.0.3 platform/shared/db/DBImportTransaction.h
rhodes-5.5.0 platform/shared/db/DBImportTransaction.h
tauplatform-1.0.3 platform/shared/db/DBImportTransaction.h
tauplatform-1.0.2 platform/shared/db/DBImportTransaction.h
tauplatform-1.0.1 platform/shared/db/DBImportTransaction.h
rhodes-3.5.1.12 platform/shared/db/DBImportTransaction.h
rhodes-3.4.2 platform/shared/db/DBImportTransaction.h