This error is being thrown on code that worked with 0.9.8. It seems to be
checking a comparison on something, but I can't figure out which "this
clause" the exception is referring to. Here's the stripped-down code
leading up to the commit:
ancient = utcnow() - timedelta(hours=8)
ancient_conn = (
(LiveSession.isconnected) &
(LiveSession.connected < ancient))
for conn in session.query(LiveSession).filter(ancient_conn):
conn.isconnected = False
conn.disconnected = func.now()
session.commit()
I've tried it without the loop and it fails about 75% of the time with the
same traceback. I'm also getting this exception on another ORM object that
has a string column and four timestamp columns (and isn't updated in a
loop). Test updating that object also gives me the same exception about 75%
of the time on flush.
Neither ORM object has any relationships or anything other than straight
column definitions.
File
"/opt/certwise-lcs/eggs/lcs.web.events-1.0.0-py2.7.egg/lcs/web/events/utility.py",
line 296, in _dead
session.commit()
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py",
line 790, in commit
self.transaction.commit()
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py",
line 392, in commit
self._prepare_impl()
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py",
line 372, in _prepare_impl
self.session.flush()
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py",
line 2004, in flush
self._flush(objects)
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py",
line 2122, in _flush
transaction.rollback(_capture_exception=True)
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py",
line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py",
line 2086, in _flush
flush_context.execute()
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/unitofwork.py",
line 373, in execute
rec.execute(self)
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/unitofwork.py",
line 532, in execute
uow
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/persistence.py",
line 170, in save_obj
mapper, table, update)
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/persistence.py",
line 613, in _emit_update_statements
lambda rec: (
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/orm/persistence.py",
line 456, in _collect_update_commands
value, state.committed_state[propkey]):
File
"/opt/certwise-lcs/eggs/SQLAlchemy-1.0.2-py2.7-linux-x86_64.egg/sqlalchemy/sql/elements.py",
line 2726, in __bool__
raise TypeError("Boolean value of this clause is not defined")
exceptions.TypeError: Boolean value of this clause is not defined
--
Bill
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.