Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jobstore Oracle drops "OperationalError ORA-03114" after adding a job (add_job) #419

Closed
srPuebla opened this issue Feb 4, 2020 · 3 comments

Comments

@srPuebla
Copy link

srPuebla commented Feb 4, 2020

Hi,

Libraries version:
APScheduler-3.5.3
SQLAlchemy-1.3.4
cx_Oracle-7.1.3
python-2.7.14

BackgroundScheduler is started (with job_store) and it works successfully (You can add jobs, jobstore works fine, etc) However, when more then 24 hours inactive (no new jobs are added or modified) the following error occurs when adding a new job "OperationalError('(cx_Oracle.OperationalError) ORA-03114: not connected to ORACLE',) "

Code OK:

job_store = SQLAlchemyJobStore(url=URL_JOBSTORE, tablename = TABLE_JOBSTORE)
_job_scheduler = BackgroundScheduler()
_job_scheduler.add_jobstore(job_store)
_job_scheduler.start()
_job_scheduler.add_job(...) #OK

Code Error:

job_store = SQLAlchemyJobStore(url=URL_JOBSTORE, tablename = TABLE_JOBSTORE)
_job_scheduler = BackgroundScheduler()
_job_scheduler.add_jobstore(job_store)
_job_scheduler.start()
#LONG TIME OPERATIONS 24 hours past
_job_scheduler.add_job(...) # drops OperationErrror exception

Error full:
OperationalError: (cx_Oracle.OperationalError) ORA-03114: not connected to ORACLE\n[SQL: INSERT INTO "jobrestore_PRE_CENTRE2_0" (id, next_run_time, job_state) VALUES (:id, :next_run_time, :job_state)] (Background on this error at: http://sqlalche.me/e/e3q8)\n'

I think that Jobstore has lost connection. Cause if you create again the scheduler it works properly. Is there any way to reconnect the Jobstore to the Database?

Thanks

@agronholm
Copy link
Owner

I suggest that you try passing engine_options={'pool_pre_ping': True} to the job store. That should prevent any errors caused by the database server closing idle connections.

@srPuebla
Copy link
Author

srPuebla commented Feb 4, 2020

Thanks so much for rapid reply. I am going to check on our application!

@srPuebla
Copy link
Author

Sorry Agronholm for delay.

Problem has been solved. Thanks so much, if i have other question, i will post!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants