[sqlalchemy] Re: Transactions

2018-01-08 Thread Tolstov Sergey
Problem fixed with delete *threaded* parameter on Flask, sorry -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for

[sqlalchemy] Re: Transactions

2018-01-08 Thread Tolstov Sergey
вторник, 9 января 2018 г., 9:08:22 UTC+3 пользователь Tolstov Sergey написал: > > I use transactions and sometimes it must be *session.rollback*. > Sometimes i get a AttributeError: 'NoneType' object has no attribute > 'twophase' > That error raises, when one transaction open and processed,

[sqlalchemy] Re: transactions with multiple potential constraint violations

2008-07-07 Thread Simon
Thanks Mike! Your last suggestion was the best (ans easiest) solution, I guess I just needed someone to point that out to me ;-) Since I want the whole transaction to either succeed or fail, there's no need to use SAVEPOINTs. Cheers, Simon On 3 Jul., 19:55, Michael Bayer [EMAIL PROTECTED]

[sqlalchemy] Re: transactions with multiple potential constraint violations

2008-07-03 Thread Michael Bayer
On Jul 3, 2008, at 1:09 PM, Simon wrote: Hi all, I have a transactional session which save()s multiple objects to multiple tables where each object potentially violates a unique primary key or just a unique key constraint. At flush() time, MySQL returns an IntegrityError which specifies

[sqlalchemy] Re: Transactions and read-only operations

2008-06-08 Thread Tomer
Wow, thanks for the detailed response! That was very helpful (and I'm going to do some more reading now on database transactions in general, and then dig deeper into how SQLAlchemy can use the different options). On Jun 8, 7:23 am, Kyle Schaffrick [EMAIL PROTECTED] wrote: On Sat, 7 Jun 2008

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread az
On Saturday 07 June 2008 21:35:35 Tomer wrote: If I am just issuing a read-only query, and I want to make sure that nothing will change in the middle, do I need a transaction? If so, what do I do with it when I'm done - commit or rollback? For example, I want to do this: for user in

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Tomer
Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional session? On Jun 7, 11:58 am, [EMAIL PROTECTED] wrote: On Saturday 07 June

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread az
On Saturday 07 June 2008 22:50:36 Tomer wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional session? no idea, never

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Lukasz Szybalski
On Sat, Jun 7, 2008 at 2:50 PM, Tomer [EMAIL PROTECTED] wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Michael Bayer
On Jun 7, 2008, at 3:50 PM, Tomer wrote: Thanks. What would happen if I didn't do anything (I've seen lots of examples online that will just issue a query like Session.query(User).all() and that's all). Will that query start a transaction if it's a transactional session? when you use the

[sqlalchemy] Re: Transactions and read-only operations

2008-06-07 Thread Tomer
Thanks for the detailed response. I have two follow-up questions: 1) From what I understand, if I read an object (eg, Student) from the database, modify that object or other objects, and then commit, I have no guarantee that the object didn't change between the time I read it and the time I

[sqlalchemy] Re: transactions

2007-01-20 Thread Jonathan Ellis
yes, you should, and your commented-out code looks fine On 1/20/07, jose [EMAIL PROTECTED] wrote: Hi all, I have a question about transactions I need to insert data into two tables (anag and user), sice I need to insert the generated primary key of anag into user. I have to flush anag

[sqlalchemy] Re: transactions

2007-01-20 Thread jose
Jonathan Ellis wrote: yes, you should, and your commented-out code looks fine thank you, Jonathan. On 1/20/07, jose [EMAIL PROTECTED] wrote: Hi all, I have a question about transactions I need to insert data into two tables (anag and user), sice I need to insert the generated

[sqlalchemy] Re: Transactions

2007-01-05 Thread Rick Morrison
You may want to turn on logging to see exactly what SQL is being issued: try adding import logging logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) to the top of your test script On 1/5/07, Paul Johnston [EMAIL PROTECTED] wrote: Hi, The following program outputs 1; I thought