Chris, this is exactly what I am doing.
See this code
DBSession.execute(
Association.__table__.delete()
.where(Association.user_id == json_body['user_id'])
.where(Association.group_id == json_body['group_id'])
)
transaction.commit()
I even include a transaction.commit() statement
But this is the SQL generated. See the ROLLBACK where I would want it to
generate a COMMT.
INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
INFO sqlalchemy.engine.base.Engine DELETE FROM Associations WHERE
Associations.user_id = %(user_id_1)s AND Associations.group_id = %(
group_id_1)s
INFO sqlalchemy.engine.base.Engine {'user_id_1': 31, 'group_id_1': '16'}
INFO sqlalchemy.engine.base.Engine ROLLBACK
On Saturday, May 2, 2015 at 5:31:18 AM UTC-6, Chris Rossi wrote:
>
> DBSession.execute(expression)
>
> Chris
>
> On Sat, May 2, 2015 at 1:09 AM, <[email protected] <javascript:>> wrote:
>
>> In my web app I sometimes use SQLAlchemy expression language rather than
>> ORM. But then DBSession is unaware of my commands. What is the proper way
>> of making DBSession flush and commit SQL in this use case?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/pylons-discuss.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.