Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 701A8200C0F for ; Thu, 2 Feb 2017 19:41:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6EAEE160B61; Thu, 2 Feb 2017 18:41:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8E698160B44 for ; Thu, 2 Feb 2017 19:41:13 +0100 (CET) Received: (qmail 49233 invoked by uid 500); 2 Feb 2017 18:41:12 -0000 Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@trafodion.apache.org Delivered-To: mailing list commits@trafodion.apache.org Received: (qmail 49224 invoked by uid 99); 2 Feb 2017 18:41:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2017 18:41:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 47BF1C1321 for ; Thu, 2 Feb 2017 18:41:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id S9xTzYZ2f-Cv for ; Thu, 2 Feb 2017 18:41:11 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id F3B325FBB2 for ; Thu, 2 Feb 2017 18:41:10 +0000 (UTC) Received: (qmail 49216 invoked by uid 99); 2 Feb 2017 18:41:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2017 18:41:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 27260DFC12; Thu, 2 Feb 2017 18:41:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: selva@apache.org To: commits@trafodion.incubator.apache.org Date: Thu, 02 Feb 2017 18:41:10 -0000 Message-Id: <05b25c9ff86b4b21af560e7f7241ba6d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-trafodion git commit: [TRAFODION-2469] TM clients like dtmci don't exit cleanly archived-at: Thu, 02 Feb 2017 18:41:14 -0000 Repository: incubator-trafodion Updated Branches: refs/heads/master 905620c9e -> ee8b16d79 [TRAFODION-2469] TM clients like dtmci don't exit cleanly Created a new API TMCLIENTEXIT in TM library to clean up opens. dtmci now calls this API before exiting Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8785bb59 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8785bb59 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8785bb59 Branch: refs/heads/master Commit: 8785bb59c7b205f7d205aaccdf6cb3ad78dd819e Parents: 81c2479 Author: selvaganesang Authored: Wed Feb 1 22:12:05 2017 +0000 Committer: selvaganesang Committed: Wed Feb 1 22:12:05 2017 +0000 ---------------------------------------------------------------------- core/sqf/export/include/dtm/tm.h | 2 +- core/sqf/src/tm/tmlib.cpp | 23 +++++++++++++++++++++++ core/sqf/src/tm/tmlib.h | 1 + core/sqf/src/tm/tools/dtmci.cpp | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8785bb59/core/sqf/export/include/dtm/tm.h ---------------------------------------------------------------------- diff --git a/core/sqf/export/include/dtm/tm.h b/core/sqf/export/include/dtm/tm.h index 8279322..0c042f7 100644 --- a/core/sqf/export/include/dtm/tm.h +++ b/core/sqf/export/include/dtm/tm.h @@ -315,6 +315,7 @@ extern "C" short JOINTRANSACTION(int64 transid); extern "C" short TMF_GETTXHANDLE_(short *handle); extern "C" short TMF_SETTXHANDLE_(short *handle); extern "C" short TMWAIT(); +extern "C" short TMCLIENTEXIT(); // Extended API extern "C" short GETTRANSID_EXT (TM_Transid_Type *transid); @@ -344,7 +345,6 @@ extern "C" short DTM_GETTRANSINFO_EXT(TM_Transid_Type pv_transid, int32 *pp_seq_ extern "C" short DTM_GETTRANSIDSTR(int64 pv_transid, char *pp_transidstr); extern "C" short DTM_GETTRANSIDSTR_EXT(TM_Transid_Type pv_transid, char *pp_transidstr); - // Internal use only!! extern "C" short DTM_QUIESCE(int32 pv_node); //Use for testing only extern "C" short DTM_UNQUIESCE(int32 pv_node); //Use for testing only http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8785bb59/core/sqf/src/tm/tmlib.cpp ---------------------------------------------------------------------- diff --git a/core/sqf/src/tm/tmlib.cpp b/core/sqf/src/tm/tmlib.cpp index 779acc5..4df9b14 100644 --- a/core/sqf/src/tm/tmlib.cpp +++ b/core/sqf/src/tm/tmlib.cpp @@ -2491,6 +2491,18 @@ int16 TMWAIT() return lv_rsp.iv_msg_hdr.miv_err.error; } +//------------------------------------------------------------------------ +// TMCLIENTEXIT +// +// Purpose : To close all the TM opens from the clients before exiting +// Params : none. +// --------------------------------------------------------------------- +int16 TMCLIENTEXIT() +{ + int16 lv_error = FEOK; + lv_error = gv_tmlib.close_tm(); + return lv_error; +} // ------------------------------------------------------------------- @@ -3274,6 +3286,17 @@ short TMLIB::abortTransactionLocal(long transactionID) return jresult; } //abortTransactionLocal +bool TMLIB::close_tm() +{ + TPT_DECL (lv_phandle); + if (!gv_tmlib.is_initialized()) + return true; + for (int i = 0; i < iv_node_count; i++) { + if (phandle_get(&lv_phandle, i) == true) + msg_mon_close_process(&lv_phandle); + } + return true; +} //---------------------------------------------------------------------------- // DTM_LOCALTRANSACTION http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8785bb59/core/sqf/src/tm/tmlib.h ---------------------------------------------------------------------- diff --git a/core/sqf/src/tm/tmlib.h b/core/sqf/src/tm/tmlib.h index d80f0b0..b1f2969 100644 --- a/core/sqf/src/tm/tmlib.h +++ b/core/sqf/src/tm/tmlib.h @@ -141,6 +141,7 @@ class TMLIB : public JavaObjectInterfaceTM short abortTransactionLocal(long transactionID); short endTransactionLocal(long transactionID); void cleanupTransactionLocal(long transactionID); + bool close_tm(); }; // helper methods, C style http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8785bb59/core/sqf/src/tm/tools/dtmci.cpp ---------------------------------------------------------------------- diff --git a/core/sqf/src/tm/tools/dtmci.cpp b/core/sqf/src/tm/tools/dtmci.cpp index c65259c..1021672 100644 --- a/core/sqf/src/tm/tools/dtmci.cpp +++ b/core/sqf/src/tm/tools/dtmci.cpp @@ -1830,6 +1830,7 @@ int main(int argc, char *argv[]) } // while if(lv_shellExec) fclose(lp_in); + TMCLIENTEXIT(); msg_mon_process_shutdown(); return 0;