pgagent using one connection to each job - Mailing list pgadmin-hackers

From Tomasz Olszak
Subject pgagent using one connection to each job
Date
Msg-id 63de3880.77fca44f.49ca1059.d06e4@o2.pl
Whole thread Raw
Responses Re: pgagent using one connection to each job  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Greetings!

I don't know if it is good mailing list but I really need help from people with more experience.

I've tried to use pgagent as job scheduler but I found two significant(for me) problems.

First: You can't execute job every for example 30 seconds, is there a way to do this? I know that one minute is often but if job will execute at 18:00 and will last for 2 seconds the next job will be executed at 18:02  it's 1:58 seconds later, for me it's rather big problem.

I'm working on online transmissions of data between postgres and Oracle. Checking if there is modified data should be every 30-20 seconds, postgres is database for big marketplaces and all data from all postgres is in one central Oracle database.

I've written lot of functions in plperlu using DBD::Oracle module to connect and get data from Oracle. All work well and really fast because of prepared_cached queries and saving connection to ora in plperlu session variable.

But when I tried to execute functions in pgagent steps they weren't work so fast.

pgagent is creating new session for each executed job and clearing session pl/perlu variables where connection to Oracle and cached queries are stored.

So my questions are:
1.  Is there a way that you can execute job more often that one minute?
2.  Can pgagent use the same session to the same job?
3.  Is it very difficult to add seconds to schedule?

I'm grateful of any of your help, if I don't  solve this problem i will have to write application to run this functions, but I really want to use pgagent.

Regards

Tomasz Olszak

pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r7753 - trunk/pgadmin3/pgadmin/ui
Next
From: Dave Page
Date:
Subject: Re: pgagent using one connection to each job