On Nov 21, 2009, at 8:51 AM, sector119 wrote: > > > On Nov 4, 7:13 pm, "Michael Bayer" <[email protected]> wrote: >> copy_from() probably creates some state that is not compatible with the >> connection being used afterwards for subsequent operations, or >> alternatively copy_from() is not compatible with some previous state. >> The pool does nothing special to the connections which it stores except >> calling rollback() when they are returned. >> >> If you can try to isolate the issue to an exact sequence of events (i.e., >> don't use a Session or ORM - just use an engine and connect()) that would >> reveal more about what's going on. > > Now I try copy_from without Session or ORM, use engine only and > everything is ok :) What does it mean? :) > > engine = create_engine(conf['sqlalchemy.url']) > connection = engine.raw_connection() > connection.cursor().cursor.copy_from(f, i.table, sep=chr(int(conf > ['import.separator'])), columns=map(str, i.fields.split(',')))
if you want a connection from the pool, and then just throw it away afterwards, call detach() on it. then you can do whatever weird things with it and it will be thrown away when you close() it (i.e. not returned to the pool or anything). -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=.
