Multithread with Progress ¿?

cesaroll

Member
Hi everyone,

I wonder if it is possible to create a multithreaded application with Progress 9.1d, and how could it be done.

Thanks in advance!
 
Define Multi-threaded application!

Progress Database is multi-threaded.

Progress Client is NOT multi-threaded but you can cheat using appservers and breaking it down into mutiple processes.
 

cesaroll

Member
My problem is this, I'm running an application using Web Client and AppServer, everything works fine, but there are some big process wich last from 30 Min. to 1 Hour or more, in this kind of process I would like to use Multithread in the Client Side so the screen could display a blink "Working Message" while the process is running.
 
I don't think that Multi-Threading is available for this.

Put the "working message" up immediately before submitting the job and then when the results come back take the "working message" off again.

I would suggest a different application structure where jobs like this are submitted to a queue by creating a record in the database, and a background task then comes along to process the job. This would seperate the data manipulation from the screen and you could have a status screen that would display that the task was "Processing" once the background job picked up the task.

This would leave the user free to carry on doing what they are doing and may speed up the background task since the processing will be local to the data.
 

cesaroll

Member
<--"Put the "working message" up immediately before submitting the job and then when the results come back take the "working message" off again."-->

That's exactly what I'm doing, the problem is that the screen goes to blank after some time of processing and the users start calling for support, we have to explain them that everything is working and wait for the process to finish.


<--"I would suggest a different application structure where jobs like this are submitted to a queue by creating a record in the database, and a background task then comes along to process the job. This would seperate the data manipulation from the screen and you could have a status screen that would display that the task was "Processing" once the background job picked up the task.

This would leave the user free to carry on doing what they are doing and may speed up the background task since the processing will be local to the data."-->

I did suggest the same thing, but they said "We don't have Provision Licenses for Unix to use it on the Servers", that's why I was trying to find another way just to let the users know that their process are running.


- Cesar

Systems Analyst
 
Umm - Ok ...

There isn't a Provision for Unix as far as I am aware...

Provision is a development toolset that include a "personal" database etc. Presumably on your database server you have either a "workgroup" or "enterprise" licence of Progress to which your clients (who have the Client Runtime version of Progress) connect.

Progress licencing changes periodically so you will need to confirm this with someone who is up-to-date on this. Your database licence allows you to have as many "background" tasks as you have clients. They are started using the -b parameter and run with no user interface.

These can be used just like any other client, but with no user interface. This means that programming them is simple but certain features like waiting for locks is a bad idea!
 

cesaroll

Member
Ahh...., so is it possibly to run a progress process directly from the Unix Server having only an enterprise license of progress? I mean, can I execute "myprocess.r" using Telnet or a Unix Script running in the server?

If so, do you have some code examples I can use? I mean syntax for executing process.

Thanks in advance!
 
PROPATH = <whatever your Propath should be>; export PROPATH

# This is necessary for jobs launched by Cron
TERM = <Terminal Type>; export TERM

${DLC}/bin/mbpro <database> <User Parameters> -p myprocess.r >> <logfile>

Enjoy!
 

cesaroll

Member
It's working, I just have a question, this is my script code "test.sh":

/usr/bin/mbpro dbname -N tcp -H host01 -S 9999 -p /usr/wrk/deve/test.r > test.log

This is working.

But when I try to use this one I get an error in PROPATH ("This is not an identifier"):

PROPATH = /usr/bin/,/usr/wrk/deve/; export PROPATH

# This is necessary for jobs launched by Cron
TERM = "VT100"; export TERM

/usr/bin/mbpro dbname -N tcp -H host01 -S 9999 -p /usr/wrk/deve/test.r > test.log


Note that I don't have any experience with Unix Scripts...
 
Use Colon :)) instead of comma (,) in the propath - and don't quote the Terminal type.

Essentially you are setting environment variables for the session that is comming up.

Also - For the test.log - change it to be >> test.log. This will append to the file, giving you a change to review the file in full rather than overwriting it each time. Put a couple of lines in the top of test.p which give an indication of the re-start and time...
 

cesaroll

Member
PROPATH = /usr/wrk/deve/; export PROPATH

# This is necessary for jobs launched by Cron
TERM = VT100; export TERM


I'm getting this error:

"PROPATH: not found"

"PROPATH^M: This is not an identifier."

Also with "TERM"
 
Mea culpa!

I think we need to lose the spaces!

PROPATH=/usr/wrk/deve/; export PROPATH
TERM=vt100; export TERM

If you write this script using a windows editor, don't save it to a shared drive on the Inix box and then run it, FTP it to the Unix box in ASCII mode. This will replace the CR-LF at the end of each line with CR which is what Unix wants (and is the source of those ^M s)

Nearly there!
 

cesaroll

Member
I have another question, this process is a complete transaction if something fails all the process rolls back.

Now with Client/Server, I mean direct connection between Client PC an Server through App Server, if the user remember something he forgot to do before this process he had the option to shut down the aplication, this cause a disconnection from the AppServer and the process rolls back.

Now I'm trying to find a way to do this I'm thinking taht the user could turn on a flag in the process control table, the running process will read it and fire its own roll back, but how can I do this, I mean is there some function like 'Roll Back Transaction' in Progress?

Thanks in Advance!
 

RKR

Member
When the flag is set you can use

UNDO, LEAVE. This will undo the transaction /*Rollback and leave */

loop:
do transaction:
repeat:

...
...
...
if lQuit /* based on flag */
then undo loop, leave loop.
end.
end
Hope this helps
grtz

cesaroll said:
I have another question, this process is a complete transaction if something fails all the process rolls back.

Now with Client/Server, I mean direct connection between Client PC an Server through App Server, if the user remember something he forgot to do before this process he had the option to shut down the aplication, this cause a disconnection from the AppServer and the process rolls back.

Now I'm trying to find a way to do this I'm thinking taht the user could turn on a flag in the process control table, the running process will read it and fire its own roll back, but how can I do this, I mean is there some function like 'Roll Back Transaction' in Progress?

Thanks in Advance!
 
Top