Joachim Selke wrote:
> sqlalchemy.exceptions.DatabaseError: (DatabaseError)
> ibm_db_dbi::DatabaseError: Binding Error: 'INSERT INTO kind_type (kind)
> VALUES (?)' [u'movie']
>
>
> I also tried connection.set_autocommit(True) but it did not change
> anything. I also do not get an error message, although this command
> definitely gets executed (I verified this with a print command right
> after the autocommit statement).
Just to give a short update:
Maybe you are suspecting the problem to be at the wrong place. I tried
to reconstruct what IMDbPY does when creating and using a cursor:
class _AlchemyConnection(object):
"""A proxy for the connection object, required since _ConnectionFairy
uses __slots__."""
def __init__(self, conn):
self.conn = conn
def __getattr__(self, name):
return getattr(self.conn, name)
import sqlalchemy
engine = sqlalchemy.create_engine('XXX')
eng_conn = engine.connect()
connection = _AlchemyConnection(eng_conn.connection)
connection.set_autocommit(True)
CURS = connection.cursor()
CURS.execute('INSERT INTO kind_type (kind) VALUES (?)', ['movie'])
This works like a charm (no matter whether it is connection or
connection.connection), whereas it doesn't work if I remove the
autocommit line completely. Thus, autocommit definitely is enabled when
I make the modification to setConnection as you suggested.
Joachim
--
M. Sc. Joachim Selke
Technische Universität Braunschweig, Institut für Informationssysteme
Mühlenpfordtstraße 23, 38106 Braunschweig, Germany
<http://www.l3s.uni-hannover.de/~selke>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Imdbpy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel