Author |
Message
|
texan |
Posted: Fri Jul 16, 2004 6:40 am Post subject: Concurrent requests to Workflow |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
We are creating a process instance object by making a call to ExecutionService.logon(). Then stating process instance and then calling logoff. This works fine when there is only one request at a time.
If we have more than one request, then the second process instance is n't getting cretaed. Am getting a message like user not logged on. I think this is because of the first one logoff.
How do you handle this kind of scenarios when concurrent request are so common in web world? |
|
Back to top |
|
 |
amittalekar |
Posted: Fri Jul 16, 2004 7:21 am Post subject: |
|
|
 Disciple
Joined: 03 Apr 2002 Posts: 166 Location: VA, USA
|
If I understand you correctly , you are using single user to create task.
In this case you can maintain session for this user (Cache that session) and don't logoff (Cosider this user as system user who will be always logged on the WF system & dedicated to this task). Offcourse , If there is no no session exists for that user in workflow then only login and create new session & use that. |
|
Back to top |
|
 |
texan |
Posted: Fri Jul 16, 2004 7:27 am Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
We are using s sinle user for logging on to WF. Upon further research, I found that If I say seecio mode as default, it is working fine. When I have it as present or present_here it's not working. can somebody elaborate why? |
|
Back to top |
|
 |
amittalekar |
Posted: Fri Jul 16, 2004 7:36 am Post subject: |
|
|
 Disciple
Joined: 03 Apr 2002 Posts: 166 Location: VA, USA
|
Yes..Thats the functinality of these modes.
If you use default mode for logging everytime you call your createProcess method (Assuming u are logging everytime in this method) , a new session will be created in workflow.
If you use present_here mode then only one session will be maintained in workflow. And if some other thread logging off means this user too is logged off.
Think of my above post... It may be your permanent solution considering performance too. |
|
Back to top |
|
 |
texan |
Posted: Mon Jul 19, 2004 8:46 am Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
If you re-use execution service, how do you deal with session expiration? I searched this forum but could n't find a real answer. Can you please help me? Thanks |
|
Back to top |
|
 |
jmac |
Posted: Mon Jul 19, 2004 10:06 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I am not sure I follow everything you are saying... but I think it may be possible that the solution to your problem is to logon with SessionMode.default. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
texan |
Posted: Mon Jul 19, 2004 11:12 am Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
JMAC,
I am trying to find out is there any way we can cache exceution service object and use same object for all interactions to WF? Thanks. |
|
Back to top |
|
 |
jmac |
Posted: Mon Jul 19, 2004 12:17 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I hate to be dense but I still don't understand.... Are you saying that you want multiple simultaneous users to use the same ExecutionService Object? This would not be a good thing. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
amittalekar |
Posted: Mon Jul 19, 2004 12:34 pm Post subject: |
|
|
 Disciple
Joined: 03 Apr 2002 Posts: 166 Location: VA, USA
|
If you are using java... u can use following code to validate session
service.refresh(); |
|
Back to top |
|
 |
texan |
Posted: Mon Jul 19, 2004 2:14 pm Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
Thanks amit. I will try that.
JMAC,
I want to use same service object for all requests whether they are simultaneous or n't.
What am trying to do is: We always have to logon to WF to create a Process Instance. Right now we are using same user id (Administrator) irrespective of who logged onto system to create work items. When we have lot of concurrent requests, logon calls have lot of overhead. So I want to create service objcet and cache it and use same object for all further requests. My question is if WF session expires how to refresh it and are there any API call to detremine whether session is expired or n't. |
|
Back to top |
|
 |
jmac |
Posted: Mon Jul 19, 2004 2:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
It is my opinion that an Execution Service object can only be used by one user at a time. If you are trying to have multiple users use the exact same ExecutionObject concurrenly you will be in trouble. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
texan |
Posted: Mon Jul 19, 2004 5:58 pm Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
Can you elaborate more? I do n't see any issues here. Thanks. |
|
Back to top |
|
 |
hos |
Posted: Mon Jul 19, 2004 11:42 pm Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
Hi,
you may consider using 'stateless API' calls. Have a look into the Programming Guide how to instrument your code to use this feature.
Basically you log on once, and then restore this session via ExecutionService.setSessionContext() calls every time before you call the server. The concept is based on the persistent OIDs that all API objects (including session) have and that can be used to re-create these objects.
Alternatively you may consider the anonymous logon feature of the Web Client. Your code could use a similar approach.
The API supports multi threaded programming. However it is in the responsibility of the client program that a single object is protected from parallell processing.
With respect to session expiration: there is no other way to avoid session expiration than setting the session setting SESSION_EXPIRATION_TIME to FOREVER. You cannot distinguish an expired session from a session that was terminated by a forced logon of the same user. In both cases the API returns RC 106. |
|
Back to top |
|
 |
kriersd |
Posted: Thu Jul 22, 2004 9:42 am Post subject: |
|
|
 Master
Joined: 22 Jul 2002 Posts: 209 Location: IA, USA
|
I think you need to take some deep thought here.
First and for most I would re-evaluate your options here. I think you can accomplish the same objective with a less complex solution. Take a look at using the EXEXMLIMPUTQ to create and start your proces instances. All you need to do is create an XML doc and send it to the EXEXMLINPUTQ. Then you don't need to worry about login and session management.
Just a thought. _________________ Dave Krier
IBM WebSphere MQ Workflow V3.4 Solution Designer |
|
Back to top |
|
 |
|