|
Home > Archive > EAserver > March 2006 > Statefull Component and Thread Manager
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Statefull Component and Thread Manager
|
|
| Pritam 2006-03-14, 1:24 pm |
| Hello All
I am using Service Component in our application. It is used to create n instance
of another Component (Calc), which is set to run at regular intervals using the
ThreadManager.
The Calc Component is a PB statefull component which checks a queue to decide if
it needs to carry out any work.
While testing I have found that when one instance is running a long process the
other instances stop working. When it has finished its work the other instances
start again.
I know that PB is not multi-threaded, but since I am creating n instances I was
expecting it to work.
Can anyone tell me what I am doing wrong?
Regards
Pritam
---== Posted via the PFCGuide Web Newsreader ==---
http://www.mcse.ms/_newsgroups/group_list.asp
| |
| Paul Horan[TeamSybase] 2006-03-14, 1:24 pm |
| Could there be database blocking going on? Can you tell where the other
instances are hanging up?
--
Paul Horan[TeamSybase]
Cynergy Systems
www.cynergysystems.com
"Pritam" <pritam._no_spam_.poojari@gmail.com> wrote in message
news:44170417$1@foru
ms-2-dub...
> Hello All
>
> I am using Service Component in our application. It is used to create n
> instance
> of another Component (Calc), which is set to run at regular intervals
> using the
> ThreadManager.
>
> The Calc Component is a PB statefull component which checks a queue to
> decide if
> it needs to carry out any work.
> While testing I have found that when one instance is running a long
> process the
> other instances stop working. When it has finished its work the other
> instances
> start again.
>
> I know that PB is not multi-threaded, but since I am creating n instances
> I was
> expecting it to work.
>
> Can anyone tell me what I am doing wrong?
>
> Regards
>
> Pritam
> ---== Posted via the PFCGuide Web Newsreader ==---
> http://www.mcse.ms/_newsgroups/group_list.asp
| |
| Pritam 2006-03-14, 8:25 pm |
| I don't think there is any database locking, I will check that tomorrow.
What i think is happening is that at one time 'run' method for only one instance
is running. i.e. the rest of the instances waits for it to complete.
Bit more detail of what I am trying to do.
1. There is service component (which runs only once when easerver starts) which
kicks of 5 instance of calc component and sets it to the thread manager to run
after 10 seconds.
2. The calc component (PB) has been declared as autodemarcation - false and
pooling - false. Hence i expect the 5 instance to be active all the time and
according to EAServer Manager it stays active.
3. Next I expect the 5 instance of calc component to 'run' every 10 seconds
simultaneously. But what I think is happening is that when the 1st instance is
'running' the remaining 4 wait for it to finish.
I will do some more tests tomorrow to verify it. Also I will try and replace the
PB component with Java component as see if that makes any difference.
Regards
Pritam
On 14 Mar 2006 12:02:01 -0800,
in sybase.public.easerver.general
Paul Horan[TeamSybase] <paul. horan@NOSPAM_cynergy
systems.com> wrote:
>Could there be database blocking going on? Can you tell where the other
>instances are hanging up?
>
>--
>Paul Horan[TeamSybase]
>Cynergy Systems
>www.cynergysystems.com
>
>"Pritam" <pritam._no_spam_.poojari@gmail.com> wrote in message
> news:44170417$1@foru
ms-2-dub...
>
>
| |
| Pritam 2006-03-15, 7:31 am |
| I have tried out using Java and it is doing exactly the same.
I am using a PB service component the run method looks like this.
********
try
getContextService( "TransactionServer", ts )
ts.CreateInstance (tm, 'CtsComponents/ThreadManager')
for l_count = 1 to 5
l_ret = ts.CreateInstance (u_calc, "CalcComponent")
try
// set the unique number of the calcs object
u_calc.fo_set_calc_server (l_count)
catch (cts_pbuserexception
e)
// error handling code
end try
// calc object will run every 'n' seconds
tm.setRunInterval ("Calc" + String (l_count), 1)
tm.start ("Calc" + String (l_count), u_calc)
next
catch (cts_pbuserexception
error)
// error handling code
end try
********
Calc component run method looks like this. I have commented my code and replaced
it with sleep to trace the problem.
********
this.GetContextService("ErrorLogging", lo_el)
lo_el.Log ('Server (' + String(li_calc_serve
r) + ") inside run"
sleep (10)
then lo_el.Log ('Server (' + String(li_calc_serve
r) + ") exit run"
********
In jaguar log i am seeing that one thread works at a time
Mar 15 12:19:41 2006: Server (3) inside run
Mar 15 12:19:51 2006: Server (3) exit run
Mar 15 12:19:51 2006: Server (4) inside run
Mar 15 12:20:01 2006: Server (4) exit run
Mar 15 12:20:01 2006: Server (5) inside run
Mar 15 12:20:11 2006: Server (5) exit run
Mar 15 12:20:11 2006: Server (1) inside run
Mar 15 12:20:21 2006: Server (1) exit run
Mar 15 12:20:21 2006: Server (2) inside run
Mar 15 12:20:31 2006: Server (2) exit run
Is this a bug or am I doing something wrong?
Regards
Pritam
| |
| Pritam 2006-03-15, 9:24 am |
| Solved the problem.
I had unchecked the Concurrency (Component is Thread Safe) setting. By enabling
the setting it is working as expected.
Cheers
Pritam
On 15 Mar 2006 05:46:11 -0800,
in sybase.public.easerver.general
Pritam <pritam._no_spam_.poojari@gmail.com> wrote:
>I have tried out using Java and it is doing exactly the same.
>
>I am using a PB service component the run method looks like this.
>********
>try
> getContextService( "TransactionServer", ts )
> ts.CreateInstance (tm, 'CtsComponents/ThreadManager')
>
> for l_count = 1 to 5
> l_ret = ts.CreateInstance (u_calc, "CalcComponent")
> try
> // set the unique number of the calcs object
> u_calc.fo_set_calc_server (l_count)
> catch (cts_pbuserexception
e)
> // error handling code
> end try
>
> // calc object will run every 'n' seconds
> tm.setRunInterval ("Calc" + String (l_count), 1)
> tm.start ("Calc" + String (l_count), u_calc)
> next
>catch (cts_pbuserexception
error)
> // error handling code
>end try
>********
>
>
>Calc component run method looks like this. I have commented my code and
replaced
>it with sleep to trace the problem.
>
>********
>this.GetContextService("ErrorLogging", lo_el)
>lo_el.Log ('Server (' + String(li_calc_serve
r) + ") inside run"
>
>sleep (10)
>
>then lo_el.Log ('Server (' + String(li_calc_serve
r) + ") exit run"
>********
>
>In jaguar log i am seeing that one thread works at a time
>
>Mar 15 12:19:41 2006: Server (3) inside run
>Mar 15 12:19:51 2006: Server (3) exit run
>Mar 15 12:19:51 2006: Server (4) inside run
>Mar 15 12:20:01 2006: Server (4) exit run
>Mar 15 12:20:01 2006: Server (5) inside run
>Mar 15 12:20:11 2006: Server (5) exit run
>Mar 15 12:20:11 2006: Server (1) inside run
>Mar 15 12:20:21 2006: Server (1) exit run
>Mar 15 12:20:21 2006: Server (2) inside run
>Mar 15 12:20:31 2006: Server (2) exit run
>
>
>Is this a bug or am I doing something wrong?
>
>Regards
>
>Pritam
|
|
|
|
|