Jump to content


- - - - -

PROIV function running in the background


6 replies to this topic

#1 Guest_Joseph V.G. Orendain_*

Guest_Joseph V.G. Orendain_*
  • Guests

Posted 20 July 2006 - 02:00 PM

Hello All,

Is it possible to have a proiv function running in the background (continuously) as a listening function so that it automatically process data when it (data) is available? (real time update). The data will be coming from another system that updates an ORACLE table on our side. Once data is written to our ORACLE table and the EOF marker is added, the running function should immediately process the data.

Another option I am thinking is, to call a unix script that does transparent login to PROIV or call a PROIV funtion straight from an ORACLE procedure or trigger once data is written to the ORACLE table from the outside system.

I know PROIV has the batch functionality but I have not been succesful in running it. If this works, another way is to have a function that runs in a loop while waiting for a data to be written in the ORACLE table. But not sure if doing it will cause any memory problems with the function.

We are running our PRO-IV under HP-Unix and ORACLE 9i.

Please advise.

Thanks a lot!!!

Joseph

#2 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 20 July 2006 - 02:26 PM

Hi,

We have written a whole load of 'Server' functions that sit as background processes and monitor 'things', such are flat files, records in ProISAM / CISAM files etc....

It all works fine, so I cant see why you could not do the same.

You just have to make sure that you do not run the CPU at 100%. IE dont just sit there LSCALLing, put in some sleeps, so you only LSCALL every second or 5 seconds. Otherwise you will get a performance problem on your server.

Rob.

#3 Guest_Joseph V.G. Orendain_*

Guest_Joseph V.G. Orendain_*
  • Guests

Posted 20 July 2006 - 02:40 PM

Hi,

We have written a whole load of 'Server' functions that sit as background processes and monitor 'things', such are flat files, records in ProISAM / CISAM files etc....

It all works fine, so I cant see why you could not do the same.

You just have to make sure that you do not run the CPU at 100%. IE dont just sit there LSCALLing, put in some sleeps, so you only LSCALL every second or 5 seconds. Otherwise you will get a performance problem on your server.

Rob.

Thanks Rob. when you say "server" function, do you mean regular functions scheduled to run using ProIV batch queue processing? Or you schedule it somewhere else? Can you please give me some details. Appreciate it.

Thanks a lot!

Joseph

#4 George Walton

George Walton

    Advanced

  • Members
  • PipPipPip
  • 83 posts
  • Gender:Male
  • Location:Markham, Canada

Posted 20 July 2006 - 04:08 PM

Hi

I have run this procedure very effectively using a Unix Crontab firing up say every minute. This can test for the presence of a file and invoke PROIV with a transparent logon. Once the PROIV has completed it must return to OFF which returns control to the Crontab. I also generally run the PROIV procedure in a Batch Queue

George Walton Sr.

#5 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 20 July 2006 - 04:17 PM

Hi

I have run this procedure very effectively using a Unix Crontab firing up say every minute. This can test for the presence of a file and invoke PROIV with a transparent logon. Once the PROIV has completed it must return to OFF which returns control to the Crontab. I also generally run the PROIV procedure in a Batch Queue

George Walton Sr.

Thanks George. That is how we execute our batch process now, thru cron, but we want it more realtime. As soon as the data is available in ORACLE, we want it process asap.

thanks!

Joseph

#6 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 20 July 2006 - 05:48 PM

Hi,

Our 'Servers' are just normal ProIV jobs sitting in the background running normal update functions.

We have a 'start' server function, that just starts lots of 'pro' processes, that then have Logon functions to different functions that just pole files. The server start functions just run the following to start a 'server'.

#X = SYSTEM('pro NTL S01 > /temp/server01_log &')

Then we add a user NTL / S01 into Proiv, and give it a start function....

Then the 'pro' jobs just sit in the background doing 'whatever'.

We have written quite a few functions around controling all the processes, checking, starting, stoping, pausing for backups etc.

We dont start a kernel each time from cron, because that would be a large resource drain because starting processes is not a great idea, esp since we have 1000 users on our system :)

I wrote this many years ago, before things like Bus & Tasks came around, so you could probably use B & T to do something the same nowerdays. However, our server solution is very simple and works a treat :)

HTHs,

Rob.

#7 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 21 July 2006 - 10:14 AM

For customers who are using Unix O/S, I use cron job to scan the existence of file(s) in a folder, and if file(s) exist then start a PRO-IV session to process it (OFF at the end of the process). I know the business requirement so I set the cron job checks the folder every 10 minutes but you can configure the corn job to suit your business needs.

But I think Rob's "server" function sounds every useful! :)



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users