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 370E2200B65 for ; Wed, 17 Aug 2016 20:35:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 35B14160A6C; Wed, 17 Aug 2016 18:35:11 +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 87AFE160A8C for ; Wed, 17 Aug 2016 20:35:10 +0200 (CEST) Received: (qmail 86199 invoked by uid 500); 17 Aug 2016 18:35:09 -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 86190 invoked by uid 99); 17 Aug 2016 18:35:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2016 18:35:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5E38C1A5ADD for ; Wed, 17 Aug 2016 18:35:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 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=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id opYI1O-BVosO for ; Wed, 17 Aug 2016 18:35:08 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 7E8C160D39 for ; Wed, 17 Aug 2016 18:35:07 +0000 (UTC) Received: (qmail 86068 invoked by uid 99); 17 Aug 2016 18:35:06 -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; Wed, 17 Aug 2016 18:35:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 96A1BE00DB; Wed, 17 Aug 2016 18:35:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbirdsall@apache.org To: commits@trafodion.incubator.apache.org Date: Wed, 17 Aug 2016 18:35:06 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] incubator-trafodion git commit: trafodion-1743 add connection session archived-at: Wed, 17 Aug 2016 18:35:11 -0000 Repository: incubator-trafodion Updated Branches: refs/heads/master 0a31bbb9a -> d9e8233c8 trafodion-1743 add connection session Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b25f9437 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b25f9437 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b25f9437 Branch: refs/heads/master Commit: b25f9437e3beb356959eaa000f1bab13c0b4a0f5 Parents: f4d9910 Author: mashengchen Authored: Mon Aug 1 07:19:14 2016 +0000 Committer: mashengchen Committed: Mon Aug 1 07:19:14 2016 +0000 ---------------------------------------------------------------------- core/conn/jdbc_type2/native/CoreCommon.h | 2 ++ core/conn/jdbc_type2/native/SQLMXConnection.cpp | 14 ++++++++++++++ core/conn/jdbc_type2/native/SrvrOthers.cpp | 9 +++++++++ 3 files changed, 25 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b25f9437/core/conn/jdbc_type2/native/CoreCommon.h ---------------------------------------------------------------------- diff --git a/core/conn/jdbc_type2/native/CoreCommon.h b/core/conn/jdbc_type2/native/CoreCommon.h index 92fc1c8..c131173 100644 --- a/core/conn/jdbc_type2/native/CoreCommon.h +++ b/core/conn/jdbc_type2/native/CoreCommon.h @@ -440,6 +440,8 @@ typedef struct _SRVR_GLOBAL_Def #define CLEAR_SCHEMA 1013 #define CQD_DOOM_USER_TXN 1014 #define CQD_PCODE_OFF 1015 +#define BEGIN_SESSION 1016 +#define END_SESSION 1017 typedef struct tagDATE_TYPE { http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b25f9437/core/conn/jdbc_type2/native/SQLMXConnection.cpp ---------------------------------------------------------------------- diff --git a/core/conn/jdbc_type2/native/SQLMXConnection.cpp b/core/conn/jdbc_type2/native/SQLMXConnection.cpp index b25d940..e554715 100644 --- a/core/conn/jdbc_type2/native/SQLMXConnection.cpp +++ b/core/conn/jdbc_type2/native/SQLMXConnection.cpp @@ -591,6 +591,20 @@ JNIEXPORT void JNICALL Java_org_trafodion_jdbc_t2_SQLMXConnection_connectInit } + odbc_SQLSvc_SetConnectionOption_sme_(NULL, NULL, + &setConnectException, + dialogueId, + BEGIN_SESSION, + 0, + NULL, + &sqlWarning); + if (setConnectException.exception_nr != CEE_SUCCESS) + { + throwSetConnectionException(jenv, &setConnectException); + FUNCTION_RETURN_VOID(("BEGIN_SESSION - setConnectException.exception_nr(%s) is not CEE_SUCCESS", + CliDebugSqlError(setConnectException.exception_nr))); + } + if(blnDoomUsrTxn) { http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b25f9437/core/conn/jdbc_type2/native/SrvrOthers.cpp ---------------------------------------------------------------------- diff --git a/core/conn/jdbc_type2/native/SrvrOthers.cpp b/core/conn/jdbc_type2/native/SrvrOthers.cpp index 16fa01e..08d8a7c 100644 --- a/core/conn/jdbc_type2/native/SrvrOthers.cpp +++ b/core/conn/jdbc_type2/native/SrvrOthers.cpp @@ -1125,6 +1125,15 @@ odbc_SQLSvc_SetConnectionOption_sme_( } strcat(sqlString, schemaValueStr); break; + case BEGIN_SESSION: + if(optionValueStr != NULL && strlen(optionValueStr) > 0) + sprintf(sqlString,"SET SESSION DEFAULT SQL_SESSION 'BEGIN:%0.200s';",optionValueStr); + else + strcpy(sqlString, "SET SESSION DEFAULT SQL_SESSION 'BEGIN';"); + break; + case END_SESSION: + strcpy(sqlString, "SET SESSION DEFAULT SQL_SESSION 'END'"); + break; case RESET_DEFAULTS: strcpy(sqlString, "CONTROL QUERY DEFAULT * RESET"); break;