I'm using 6 connections at the same time, 3 go to different databases on the same server, and 3 to totally different servers. Each connection has a different name
db = DAL('mysql://crm:password@localhost:3307/CRM',migrate_enabled=True) db_us = DAL('mysql://web_US:password@localhost:3307/DataUS',migrate_enabled=False, fake_migrate_all=True) db_ca = DAL('mysql://web_CA:password@localhost:3307/DataCA', migrate_enabled=False, fake_migrate_all=True) ... Could something like this be a problem: In a scheduler function, based on application that inserted a task, I assign relevant connection to another object to use? if application='ca': db_front_end = db_ca elif application='us': db_front_end = db_us use db_front_end to retrieve data and perform scheduled task On Thu, Oct 4, 2012 at 9:42 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > This error can arise in two cases: > - you are using an a recent trunk version (not the latest) which has a bug > - you are using the latest trunk (no bug) but you have a duplicated > connection in your code: > > db = DAL(....) > db = DAL(....) > > perhaps in different model files. Previous web2py did not check and > allowed you to have two connections to the same database. We found this is > often source or errors. The new web2py checks and does not allow you to do > it. Your would get the error you see. > > > On Thursday, 4 October 2012 14:42:59 UTC-5, Adi wrote: > >> We promoted latest night build to production, and scheduler started >> failing. At the same time there were some code changes, so I'm having a >> hard time tracing the source of the problem. >> >> Any insights while I'm trying to figure it out? >> >> Thanks, >> Adi >> >> db: mysql >> redhat linux >> w2p: Version 2.0.9 (2012-10-02 03:55:58) dev >> >> scheduler_run table: traceback field: >> Traceback (most recent call last): >> File "/opt/web-apps/web2py/gluon/**scheduler.py", line 203, in executor >> _env = env(a=a,c=c,import_models=**True) >> File "/opt/web-apps/web2py/gluon/**shell.py", line 134, in env >> sys.exit(1) >> SystemExit: 1 >> >> >> scheduler log: >> /opt/web-apps/web2py/gluon/**dal.py:6597: DeprecationWarning: >> object.__new__() takes no parameters >> db = super(DAL, cls).__new__(cls, uri, *args, **kwargs) >> web2py Web Framework >> Created by Massimo Di Pierro, Copyright 2007-2012 >> Version 2.0.9 (2012-10-02 03:55:58) dev >> Database drivers available: SQLite(sqlite3), MySQL(pymysql), >> PostgreSQL(pg8000), IMAP(imaplib) >> starting single-scheduler for "crm"... >> Traceback (most recent call last): >> File "/opt/web-apps/web2py/gluon/**restricted.py", line 209, in >> restricted >> exec ccode in environment >> File "applications/crm/models/db.**py", line 47, in <module> >> db = >> DAL('mysql://crm:password@**localhost:3307/CRM',migrate_**enabled=False, >> fake_migrate_all=True) >> File "/opt/web-apps/web2py/gluon/**dal.py", line 6595, in __new__ >> raise RuntimeError, 'Cannot duplicate a Singleton' >> RuntimeError: Cannot duplicate a Singleton >> >> -- > > > > --