diff --git a/lang_helpers/gds_codes.ftn b/lang_helpers/gds_codes.ftn index 50c565338c..81dd6ece77 100644 --- a/lang_helpers/gds_codes.ftn +++ b/lang_helpers/gds_codes.ftn @@ -1822,6 +1822,8 @@ C -- PARAMETER (GDS__db_crypt_key = 335545204) INTEGER*4 GDS__no_keyholder_plugin PARAMETER (GDS__no_keyholder_plugin = 335545205) + INTEGER*4 GDS__ses_reset_err + PARAMETER (GDS__ses_reset_err = 335545206) INTEGER*4 GDS__gfix_db_name PARAMETER (GDS__gfix_db_name = 335740929) INTEGER*4 GDS__gfix_invalid_sw diff --git a/lang_helpers/gds_codes.pas b/lang_helpers/gds_codes.pas index f77ae737f7..8b15eec95e 100644 --- a/lang_helpers/gds_codes.pas +++ b/lang_helpers/gds_codes.pas @@ -1817,6 +1817,8 @@ const gds_db_crypt_key = 335545204; isc_no_keyholder_plugin = 335545205; gds_no_keyholder_plugin = 335545205; + isc_ses_reset_err = 335545206; + gds_ses_reset_err = 335545206; isc_gfix_db_name = 335740929; gds_gfix_db_name = 335740929; isc_gfix_invalid_sw = 335740930; diff --git a/src/include/gen/codetext.h b/src/include/gen/codetext.h index 2f2676e8a5..c3a76dd800 100644 --- a/src/include/gen/codetext.h +++ b/src/include/gen/codetext.h @@ -907,6 +907,7 @@ static const struct { {"vld_plugins", 335545203}, {"db_crypt_key", 335545204}, {"no_keyholder_plugin", 335545205}, + {"ses_reset_err", 335545206}, {"gfix_db_name", 335740929}, {"gfix_invalid_sw", 335740930}, {"gfix_incmp_sw", 335740932}, diff --git a/src/include/gen/iberror.h b/src/include/gen/iberror.h index aa96cc3856..c73d1f1b0b 100644 --- a/src/include/gen/iberror.h +++ b/src/include/gen/iberror.h @@ -941,6 +941,7 @@ const ISC_STATUS isc_hdr_overflow = 335545202L; const ISC_STATUS isc_vld_plugins = 335545203L; const ISC_STATUS isc_db_crypt_key = 335545204L; const ISC_STATUS isc_no_keyholder_plugin = 335545205L; +const ISC_STATUS isc_ses_reset_err = 335545206L; const ISC_STATUS isc_gfix_db_name = 335740929L; const ISC_STATUS isc_gfix_invalid_sw = 335740930L; const ISC_STATUS isc_gfix_incmp_sw = 335740932L; @@ -1415,7 +1416,7 @@ const ISC_STATUS isc_trace_switch_user_only = 337182757L; const ISC_STATUS isc_trace_switch_param_miss = 337182758L; const ISC_STATUS isc_trace_param_act_notcompat = 337182759L; const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L; -const ISC_STATUS isc_err_max = 1359; +const ISC_STATUS isc_err_max = 1360; #else /* c definitions */ @@ -2326,6 +2327,7 @@ const ISC_STATUS isc_err_max = 1359; #define isc_vld_plugins 335545203L #define isc_db_crypt_key 335545204L #define isc_no_keyholder_plugin 335545205L +#define isc_ses_reset_err 335545206L #define isc_gfix_db_name 335740929L #define isc_gfix_invalid_sw 335740930L #define isc_gfix_incmp_sw 335740932L @@ -2800,7 +2802,7 @@ const ISC_STATUS isc_err_max = 1359; #define isc_trace_switch_param_miss 337182758L #define isc_trace_param_act_notcompat 337182759L #define isc_trace_mandatory_switch_miss 337182760L -#define isc_err_max 1359 +#define isc_err_max 1360 #endif diff --git a/src/include/gen/msgs.h b/src/include/gen/msgs.h index e13f766493..ac42391bfe 100644 --- a/src/include/gen/msgs.h +++ b/src/include/gen/msgs.h @@ -910,6 +910,7 @@ Data source : @4"}, /* eds_statement */ {335545203, "No matching client/server authentication plugins configured for execute statement in embedded datasource"}, /* vld_plugins */ {335545204, "Missing database encryption key for your attachment"}, /* db_crypt_key */ {335545205, "Key holder plugin @1 failed to load"}, /* no_keyholder_plugin */ + {335545206, "Cannot reset user session with open transactions (@1 active)"}, /* ses_reset_err */ {335740929, "data base file name (@1) already given"}, /* gfix_db_name */ {335740930, "invalid switch @1"}, /* gfix_invalid_sw */ {335740932, "incompatible switch combination"}, /* gfix_incmp_sw */ diff --git a/src/include/gen/sql_code.h b/src/include/gen/sql_code.h index d89d7d6308..442596b528 100644 --- a/src/include/gen/sql_code.h +++ b/src/include/gen/sql_code.h @@ -906,6 +906,7 @@ static const struct { {335545203, -901}, /* 883 vld_plugins */ {335545204, -902}, /* 884 db_crypt_key */ {335545205, -104}, /* 885 no_keyholder_plugin */ + {335545206, -901}, /* 886 ses_reset_err */ {335740929, -901}, /* 1 gfix_db_name */ {335740930, -901}, /* 2 gfix_invalid_sw */ {335740932, -901}, /* 4 gfix_incmp_sw */ diff --git a/src/include/gen/sql_state.h b/src/include/gen/sql_state.h index 1cf4a3146e..b255fc662e 100644 --- a/src/include/gen/sql_state.h +++ b/src/include/gen/sql_state.h @@ -906,6 +906,7 @@ static const struct { {335545203, "28000"}, // 883 vld_plugins {335545204, "08004"}, // 884 db_crypt_key {335545205, "HY024"}, // 885 no_keyholder_plugin + {335545206, "01002"}, // 886 ses_reset_err {335740929, "00000"}, // 1 gfix_db_name {335740930, "00000"}, // 2 gfix_invalid_sw {335740932, "00000"}, // 4 gfix_incmp_sw diff --git a/src/jrd/Attachment.cpp b/src/jrd/Attachment.cpp index fd43d4c2c9..941c89895e 100644 --- a/src/jrd/Attachment.cpp +++ b/src/jrd/Attachment.cpp @@ -383,6 +383,16 @@ void Jrd::Attachment::releaseGTTs(thread_db* tdbb) void Jrd::Attachment::resetSession(thread_db* tdbb) { + if (att_transactions) + { + int n = 0; + for (const jrd_tra* tra = att_transactions; tra; tra = tra->tra_next) + n++; + + // Cannot reset user session with open transactions (@1 active) + ERR_post(Arg::Gds(isc_ses_reset_err) << Arg::Num(n)); + } + // reset DecFloat att_dec_status = DecimalStatus::DEFAULT; att_dec_binding = DecimalBinding::DEFAULT; diff --git a/src/msgs/facilities2.sql b/src/msgs/facilities2.sql index 0823a0eb54..bcc3b7902c 100644 --- a/src/msgs/facilities2.sql +++ b/src/msgs/facilities2.sql @@ -1,7 +1,7 @@ /* MAX_NUMBER is the next number to be used, always one more than the highest message number. */ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES (?, ?, ?, ?); -- -('2018-05-05 16:40:00', 'JRD', 0, 886) +('2018-06-01 11:50:00', 'JRD', 0, 887) ('2015-03-17 18:33:00', 'QLI', 1, 533) ('2015-01-07 18:01:51', 'GFIX', 3, 134) ('1996-11-07 13:39:40', 'GPRE', 4, 1) diff --git a/src/msgs/messages2.sql b/src/msgs/messages2.sql index 72f6cef0ef..6c550cdbcf 100644 --- a/src/msgs/messages2.sql +++ b/src/msgs/messages2.sql @@ -993,6 +993,7 @@ Data source : @4', NULL, NULL) ('vld_plugins', NULL, 'ValidatePassword.cpp', NULL, 0, 883, NULL, 'No matching client/server authentication plugins configured for execute statement in embedded datasource', NULL, NULL); ('db_crypt_key', NULL, 'CryptoManager.cpp', NULL, 0, 884, NULL, 'Missing database encryption key for your attachment', NULL, NULL); ('no_keyholder_plugin', NULL, 'mvol.cpp', NULL, 0, 885, NULL, 'Key holder plugin @1 failed to load', NULL, NULL); +('ses_reset_err', NULL, 'Attachment.cpp', NULL, 0, 886, NULL, 'Cannot reset user session with open transactions (@1 active)', NULL, NULL); -- QLI (NULL, NULL, NULL, NULL, 1, 0, NULL, 'expected type', NULL, NULL); (NULL, NULL, NULL, NULL, 1, 1, NULL, 'bad block type', NULL, NULL); diff --git a/src/msgs/system_errors2.sql b/src/msgs/system_errors2.sql index d1e582768b..65597cb3ff 100644 --- a/src/msgs/system_errors2.sql +++ b/src/msgs/system_errors2.sql @@ -892,6 +892,7 @@ set bulk_insert INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, FA (-901, '28', '000', 0, 883, 'vld_plugins', NULL, NULL) (-902, '08', '004', 0, 884, 'db_crypt_key', NULL, NULL) (-104, 'HY', '024', 0, 885, 'no_keyholder_plugin', NULL, NULL) +(-901, '01', '002', 0, 886, 'ses_reset_err', 2, 'ERROR') -- GFIX (-901, '00', '000', 3, 1, 'gfix_db_name', NULL, NULL) (-901, '00', '000', 3, 2, 'gfix_invalid_sw', NULL, NULL)