예제 #1
0
	VarValue Call(RCString method, const vector<VarValue>& params = vector<VarValue>()) {
		Ext::WebClient wc = GetWebClient();
		wc.Proxy = nullptr;		//!!!?
		wc.CacheLevel = RequestCacheLevel::BypassCache;
		wc.Credentials.UserName = !Login.empty() ? Login : RpcUrl.UserName;
		wc.Credentials.Password = !Password.empty() ? Password : RpcUrl.Password;

		String sjson;
		try {
			DBG_LOCAL_IGNORE_CONDITION_OBJ(error_condition(500, http_category()));

			sjson = wc.UploadString(RpcUrl.ToString(), JsonRpc.Request(method, params));
		} catch (WebException& ex) {
			if (ex.code() == http_error::unauthorized)
				throw;
			sjson = ex.Result;
		}
#ifdef X_DEBUG//!!!D
		cout << sjson << endl;
#endif

		EXT_LOCKED(MtxHeaders, Headers = wc.get_ResponseHeaders());
/*!!!R			XStratum = h.Get("X-Stratum");
			XSwitchTo = h.Get("X-Switch-To");
			XHostList = h.Get("X-Host-List");*/

		return JsonRpc.ProcessResponse(ParseJson(sjson));
	}
예제 #2
0
	void Rollback() override { EXT_LOCKED(MtxSqlite, m_db.Rollback()); }
예제 #3
0
	void Commit() override { EXT_LOCKED(MtxSqlite, m_cmdCommit.ExecuteNonQuery()); }
예제 #4
0
	void BeginTransaction() override {
		EXT_LOCKED(MtxSqlite, m_cmdBeginExclusive.ExecuteNonQuery());
	//	EXT_LOCKED(MtxSqlite, m_db.BeginTransaction());
	 }