Github user sbroeder commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/6#discussion_r33104933
--- Diff: core/sqf/src/tm/tmlib.cpp ---
@@ -647,6 +647,21 @@ short REGISTERREGION(long transid, long startid, int
pv_port, char *pa_hostname,
}
TM_Transaction *lp_currTrans = gp_trans_thr->get_current();
+ // Check if the passed-in transid is known to the thread
+ // if so, make that Transid current
+ if (lp_currTrans == NULL) {
+ lp_currTrans = gp_trans_thr->get_trans
(lv_transid.get_native_type());
+ if (lp_currTrans != NULL)
+ gp_trans_thr->set_current(lp_currTrans);
+ }
+ // Check if the thread's current transid matches the passed-in transid
+ // If not, check if the passed-in transid is known to the thread
+ // if so, make that Transid current
+ else if (! lp_currTrans->equal(lv_transid)) {
+ lp_currTrans = gp_trans_thr->get_trans
(lv_transid.get_native_type());
+ if (lp_currTrans != NULL)
+ gp_trans_thr->set_current(lp_currTrans);
+ }
TM_Transseq_Type lv_savedStartId = gp_trans_thr->get_startid();
--- End diff --
I think we need some code similar to this:
if (lv_savedStartId != lv_startid) {
gp_trans_thr->set_startid(lv_startid);
}
Then we should pass lv_startid not lv_savedStartId into the call at line
677.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---