On 10 May 2006, at 6:03 PM, alanp wrote:
On 10 May 2006, at 5:56 PM, Jonathan Ellis wrote:
On 5/10/06, alanp <[EMAIL PROTECTED]> wrote:
The problem is that the commit in the parent process fails with a
psycopg error (ProgrammingError: "SET TRANSACTION ISOLATION
LEVEL...")
when trying to update the PID, etc (but only if it has started more
than 1 child).
Sounds like a non-SA-related concurrency violation, but it's hard to
say w/o the full error message. ("SET TRANSACTION ISOLATION LEVEL"
will never error out by itself.)
You're quite right. The rest of the error messages was something to do
about having to set the transaction isolation level for each query.
Let me undo my 'fixes' so that I can get the complete error message
before making more of a fool of myself :-)
Sorry about the delay...
As threatened, the full error message is:
SQLError: (ProgrammingError) ERROR: SET TRANSACTION ISOLATION LEVEL
must be called before any query
The SQL:
SELECT jobs.job_status AS jobs_job_status, jobs.job_id AS jobs_job_id,
jobs.job_start_time AS jobs_job_start_time, jobs.job_pid AS
jobs_job_pid, jobs.job_exit_code AS jobs_job_exit_code,
jobs.job_create_time AS jobs_job_create_time, jobs.job_end_time AS
jobs_job_end_time, jobs.job_name AS jobs_job_name
FROM jobs
WHERE jobs.job_pid = 4112 'SELECT jobs.job_status AS jobs_job_status,
jobs.job_id AS jobs_job_id, jobs.job_start_time AS jobs_job_start_time,
jobs.job_pid AS jobs_job_pid, jobs.job_exit_code AS jobs_job_exit_code,
jobs.job_create_time AS jobs_job_create_time, jobs.job_end_time AS
jobs_job_end_time, jobs.job_name AS jobs_job_name \nFROM jobs \nWHERE
jobs.job_pid = %(jobs_job_pid)s' {'jobs_job_pid': 4112}
The stack trace is:
File "/caprisa/devel/pipeline/web/trunk/Src/pipeng/job/job.py", line
99, in FindByPid
rs = Job.mapper.select(tables.jobs.c.pid == pid)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/mapping/mapper.py", line 492, in select
return self.select_whereclause(arg, **kwargs)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/mapping/mapper.py", line 496, in
select_whereclause
return self._select_statement(statement, params=params)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/mapping/mapper.py", line 516, in _select_statement
return self.instances(statement.execute(**params), **kwargs)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/sql.py", line 436, in execute
return c.execute(*multiparams, **params)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/sql.py", line 330, in execute
return self.engine.execute_compiled(self, params)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/engine.py", line 595, in execute_compiled
proxy(str(compiled), parameters)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/engine.py", line 590, in proxy
self.execute(statement, parameters, connection=connection,
cursor=cursor, return_raw=True)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/engine.py", line 641, in execute
self._execute(cursor, statement, parameters)
File
"/caprisa/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-
py2.4.egg/sqlalchemy/engine.py", line 661, in _execute
raise exceptions.SQLError(statement, parameters, e)
BTW I'm using psycopg 1.1.18.
Would using psycopg's autocommit=1 or serialize=1 work? If so a quick
scan of the docs seem to indicate I need to provide create_engine()
with a customised pool .QueuePool (replacing the connection creation
with my own). Am I on the right track?
Thanks
Alan
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users