Discussion:
Threadmanager and EAS 6.2
(too old to reply)
Will
2009-06-30 04:57:17 UTC
Permalink
We are migrating from PB10.5/EAS5.2 to PB11.5/EAS6.2. Our application
includes a service component that uses CTSComponents/Threadmanager to
spawn new threads. The code worked fine in EAS5.2 however now we are
getting a runtime function error referring to the in_tm.start
(ls_thread_group, lpo) line of code below, at compile time everything
looks fine. Is there anything different we need to do in EAS6.2?

The code is as follows:

string ls_err, ls_thread_group, ls_component, ls_queue
long ll_run_interval = -1, ll_job_id
n_proc_base ln_proc
n_controller_base ln_ctrl
powerobject lpo


// --- check the rowcount
if al_row < 1 OR al_row > ads.Rowcount() then
ls_err = "Invalid row supplied to function"
GOTO error
end if

ls_queue = ads.GetItemString(al_row, CIS_THREAD)
ls_component = ads.GetItemString(al_row, CIS_COMP)
ll_job_id = ads.GetItemNumber(al_row, CIS_JOB)


if error.uf_is_failure(in_srv.uf_create_component(ls_component,
ln_ctrl)) then
RETURN error.uf_error()
end if

ln_ctrl.initialise_job(ll_job_id, al_profile_id)


// --- make sure we have a threadmanager proxy
if error.uf_is_failure(This.uf_get_threadmanager()) then GOTO error


// --- build the thread group name
if error.uf_is_failure(in_srv.uf_build_thread_name(ls_queue,
ls_thread_group, al_profile_id)) then GOTO error


if ll_run_interval >= 0 then
// --- set the run interval - check for syserrors
in_tm.setRunInterval(ls_thread_group, ll_run_interval)
if NOT error.uf_is_ok() then GOTO error
end if

// --- start the thread (need to broaden to a powerobject)
lpo = ln_ctrl

in_tm.start(ls_thread_group, lpo)
if NOT error.uf_is_ok() then GOTO error

in_srv.uf_dbg_life(This, "uf_start_thread()", "Thread started
successfully")

// --- success
RETURN error.uf_ok()

ERROR:

RETURN error.uf_int_err(This, "uf_start_thread()", ls_err)


The log error is:
2009-06-30 14:30:41.359 INFO Thread-6 [JaguarServer] Runtime Error in
PB Component: Bad runtime function reference at line 82 in function
uf_start_thread of object n_cst_thread.
Millard F. Brown III[Team Sybase]
2009-07-08 14:54:06 UTC
Permalink
try defining lpo as a corbaobject.
--
Regards,
Millard[TeamSybase]
Post by Will
We are migrating from PB10.5/EAS5.2 to PB11.5/EAS6.2. Our application
includes a service component that uses CTSComponents/Threadmanager to
spawn new threads. The code worked fine in EAS5.2 however now we are
getting a runtime function error referring to the in_tm.start
(ls_thread_group, lpo) line of code below, at compile time everything
looks fine. Is there anything different we need to do in EAS6.2?
string ls_err, ls_thread_group, ls_component, ls_queue
long ll_run_interval = -1, ll_job_id
n_proc_base ln_proc
n_controller_base ln_ctrl
powerobject lpo
// --- check the rowcount
if al_row < 1 OR al_row > ads.Rowcount() then
ls_err = "Invalid row supplied to function"
GOTO error
end if
ls_queue = ads.GetItemString(al_row, CIS_THREAD)
ls_component = ads.GetItemString(al_row, CIS_COMP)
ll_job_id = ads.GetItemNumber(al_row, CIS_JOB)
if error.uf_is_failure(in_srv.uf_create_component(ls_component,
ln_ctrl)) then
RETURN error.uf_error()
end if
ln_ctrl.initialise_job(ll_job_id, al_profile_id)
// --- make sure we have a threadmanager proxy
if error.uf_is_failure(This.uf_get_threadmanager()) then GOTO error
// --- build the thread group name
if error.uf_is_failure(in_srv.uf_build_thread_name(ls_queue,
ls_thread_group, al_profile_id)) then GOTO error
if ll_run_interval >= 0 then
// --- set the run interval - check for syserrors
in_tm.setRunInterval(ls_thread_group, ll_run_interval)
if NOT error.uf_is_ok() then GOTO error
end if
// --- start the thread (need to broaden to a powerobject)
lpo = ln_ctrl
in_tm.start(ls_thread_group, lpo)
if NOT error.uf_is_ok() then GOTO error
in_srv.uf_dbg_life(This, "uf_start_thread()", "Thread started
successfully")
// --- success
RETURN error.uf_ok()
RETURN error.uf_int_err(This, "uf_start_thread()", ls_err)
2009-06-30 14:30:41.359 INFO Thread-6 [JaguarServer] Runtime Error in
PB Component: Bad runtime function reference at line 82 in function
uf_start_thread of object n_cst_thread.
Will
2009-07-09 00:39:46 UTC
Permalink
I will try corbaobject, have tried nonvisualobject but got the same
result.

A bit of further investigation seems to point to the interim
assignment somehow being the issue (this did work in EAS5.2 and
previous versions) e.g.

The following does not work, run function is not found when object
passed to threadmanager (run function is defined in n_controller_base)
1) create descendant object and assign to ancestor n_controller_base
(ln_ctrl variable)
2) call function initialise_job on ln_ctrl
3) assign ln_ctrl variable to lpo
4) pass lpo to threadmanager in start call

The following does find the run function (although the initialise
function is not called)
1) create descendant object and assign to powerobject (lpo)
2) pass lpo to threadmanager in start call

Loading...