Wednesday, 15 July 2015

python - How do SQLAlchemy Connections relate to Session-based transactions? -


I am currently working on a new web application for which to execute an SQL statement before applying session I need

in detail: I am running a PostgreSQL database server with multiple schemas and I need to execute a SET search_path statement before using the session. I also use the ZopeTransactionExtension to automate the transaction. I am doing the request level.

To ensure the execution of the SQL statement, there are two possible ways:

  • Performing statements at the engine / connection level through SQLLame program (from) < / Li>
  • Performing the Statement on Session Level (from)

    Since I am using a Scod session and want to maintain my transaction, I am surprised that In which ways beyond transaction management Knowledge can be. For example, engine every query from the pool? Or is it linked to attachment for its lifetime, i.e. until the request was processed and the session & amp; Are the transactions closed / committed?

    On the other hand, because I'm using a Scod session, can I recommend it to Zzac in another link?

    Is there any such third way that I am missing?

    = true, that should not be the case.

    Or it is linked to the session for its lifetime, i.e. until the request is processed and the session & amp; Are the transactions closed / committed?

    This is enclosed per transaction, but "Search_path" in PostGrasecl is a per postgrescale session (to not be confused with SQLite session) - this is basically the life span of the connection.

    The session (and the engine and the pool) these days you have a week's hook to establish such a situation that you can catch. If you want to be with the session then you can try.

  • No comments:

    Post a Comment