[sqlalchemy] django middleware or signals for sqlalchemy Session

2009-04-23 Thread davidlmontgomery
I would like to know if there is a consensus on the best way to set up and remove sqlalchemy Sessions in django. I figure I'm either going to use middleware, something like this thread: http://groups.google.com/group/django-users/browse_thread/thread/e6749f7eec1cc46c/ef9d9e27943af830 or I'm

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-24 Thread davidlmontgomery
virtual windows machine and it all works for me.     note that dsn is now the default interpretation of host in 0.5, i.e.   connect using mssql://dsn.   perhaps you've got multiple database   instances being accesed across SQLA versions. On Mar 21, 2009, at 8:01 PM, davidlmontgomery wrote

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-24 Thread davidlmontgomery
On Mar 24, 2:40 pm, Michael Bayer mike...@zzzcomputing.com wrote: what if you create the same table on a totally new database and run it there ? Good idea. I'll try that momentarily. In the meantime, I tried out wireshark and see that there is a reliable difference in what is getting sent.

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-24 Thread davidlmontgomery
TRAN Query: SELECT COUNT(*) FROM sa_test WHERE data='bingo' Query: IF @@TRANCOUNT 0 ROLLBACK TRAN So, no BEGIN TRANSACTION (or SET IMPLICIT_TRANSACTIONS OFF). On Mar 24, 3:31 pm, davidlmontgomery davidlmontgom...@gmail.com wrote: On Mar 24, 2:40 pm, Michael Bayer mike

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-24 Thread davidlmontgomery
The relevant change is the addition of the MSSQLDialect.do_begin method: def do_begin(self, connection): cursor = connection.cursor() cursor.execute(SET IMPLICIT_TRANSACTIONS OFF) cursor.execute(BEGIN TRANSACTION) This was first introduced three months ago to correct

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-24 Thread davidlmontgomery
On Mar 24, 5:50 pm, Michael Trier mtr...@gmail.com wrote: The way it is structured now seems to work fine in all the tests, so it's odd that you're having a problem. My only guess is that it's a TDS thing (I believe you said you were using that). The odd thing is that the list of items

[sqlalchemy] Re: 0.5.2 seems to always roll back with mssql

2009-03-21 Thread davidlmontgomery
Thanks Mike and Michael for your suggestions. remove() will roll back any existing transaction Yes, this is what I am seeing. but the commit() call previously will issue a COMMIT for any pending data. And this COMMIT is succeeding with 0.4.8, but it is not succeeding with 0.5.2. the

[sqlalchemy] 0.5.2 seems to always roll back with mssql

2009-03-20 Thread davidlmontgomery
I'm using sqlalchemy with sql server express. Client-side is also Windows, running python 2.5.2. I find that all my changes get rolled back when using 0.5.2. But using 0.4.8, things work as I expect. Here is an example script: --- start script --- import datetime import sqlalchemy from

[sqlalchemy] 0.4 or 0.5 for new user, legacy mssql db

2009-02-03 Thread davidlmontgomery
Hi Folks, I would like your recommendations for whether I should use sqlalchemy version 0.4.x or 0.5.x. I'm using it with django for talking to a secondary MS SQL server database. This is a legacy db where I'm be autoloading the schema. I'm just getting started with sqlalchemy and I probably