Re: [Sqlalchemy-users] session trouble

2006-09-19 Thread Jose Galvez
Thanks everyone for all the help, it seems to be working now that I'm using explicit sessions rather then the threaded one I had been using Jose Jose Galvez wrote: > Dear sqlalchemy users, I'm pretty new to sqlalchemy and I've run into a > problem that I cant seem to figure out. Here is what I ca

Re: [Sqlalchemy-users] session trouble

2006-09-19 Thread William K. Volkman
Hello, On Mon, 2006-09-18 at 23:14, Jose Galvez wrote: > > > > uin = dbsession.query(model.Wsi).get_by(uin=image) > > if uin: > > xml = uin.xml > > else: > > uin=model.Wsi() > > uin.uin=image > > xm

Re: [Sqlalchemy-users] MySQL 4.1.11-debian: Commands out of sync; you can't run this command now

2006-09-19 Thread Michael Bayer
hey there - attached is another patch, which affects the instrumented Cursor and Connection objects so that it is impossible to return a connection to the pool without all cursors being closed; it throws an error otherwise. after running all the unit tests with SA, the only time this happen

Re: [Sqlalchemy-users] Postgres specific: How would i do a VACUUM?

2006-09-19 Thread Michael Bayer
conn.close() will ultimately result in the underlying connection being returned to the connection pool. you probably want to turn the AUTOCOMMIT flag back off before doing so. thats why it might be nicer to build some construct in SA for operations like this to be easier. On Sep 19, 2006,

Re: [Sqlalchemy-users] Postgres specific: How would i do a VACUUM?

2006-09-19 Thread Sol
Michael Bayer wrote: > we generally leave autocommit turned off on the DBAPI connections (which > implies theres always a transaction in progress). you might want to see > if a straight psycopg2 connection, with autocommit turned on, can even > do this. through SA, you can get at the underlying c

Re: [Sqlalchemy-users] Postgres specific: How would i do a VACUUM?

2006-09-19 Thread Michael Bayer
we generally leave autocommit turned off on the DBAPI connections (which implies theres always a transaction in progress). you might want to see if a straight psycopg2 connection, with autocommit turned on, can even do this. through SA, you can get at the underlying connection and do the

[Sqlalchemy-users] Postgres specific: How would i do a VACUUM?

2006-09-19 Thread Sol
Hello list, I want to do a VACUUM FULL ANALYZE in database maintenance code with SA. When i do: metadata.engine.execute("VACUUM FULL ANALYZE;") I get: SQLError: (ProgrammingError) VACUUM cannot run inside a transaction block 'VACUUM FULL ANALYZE;' {} Is there a workaround. How would i execute s

Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions?

2006-09-19 Thread Mongoose
On Mon, 18 Sep 2006 20:09:48 +0200 Wolfgang Keller <[EMAIL PROTECTED]> wrote: > Just because I don't want to have to take care of all this "transaction > management" myself, as this is complete rocket-science to me... I know not of ACID, but... rocket science this is not. trans = session.create

Re: [Sqlalchemy-users] Self referencing tables

2006-09-19 Thread Mongoose
On Mon, 18 Sep 2006 20:29:22 -0400 Michael Bayer <[EMAIL PROTECTED]> wrote: > youre looking for a self-referential mapper. there are three > examples of this in... Thanks I'll check those out! My current solution is one big huge duh that I can't believe I didn't think of before. class Node:

Re: [Sqlalchemy-users] Failure to compile

2006-09-19 Thread Mongoose
On Mon, 18 Sep 2006 20:19:20 -0400 Michael Bayer <[EMAIL PROTECTED]> wrote: > somehow you have the User class getting stuck in as a column > somewhere...it is probably a subtle mistake in your syntax somewhere Yeah that was exactly the problem. I was doing something like ...select(User.paren

Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions?

2006-09-19 Thread Michael Bayer
On Sep 19, 2006, at 8:19 AM, Wolfgang Keller wrote: > > I forgot to mention that what I have in mind are not several > instances of > SQLAlchemy, but a single instance which would be part of something > like an > "application server". Then all client requests would be processed > by one and

Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions?

2006-09-19 Thread Wolfgang Keller
Hello, > as far as basic transactional sanity, its reasonable; we imitate the > constructs used by Hibernate. in a concurrent environment, I forgot to mention that what I have in mind are not several instances of SQLAlchemy, but a single instance which would be part of something like an "ap

Re: [Sqlalchemy-users] database literature

2006-09-19 Thread Alexandre CONRAD
Thanks to all for the suggestions. Feel free to keep sending more references... :) Marco Mariani wrote: > I'd like to add the following books to the pile of suggestions. > > These are not for fresh beginners, and can be useful to many. Both are > new, and available on Safari. > > > Refactorin

Re: [Sqlalchemy-users] database literature

2006-09-19 Thread Marco Mariani
I'd like to add the following books to the pile of suggestions. These are not for fresh beginners, and can be useful to many. Both are new, and available on Safari. Refactoring Databases: Evolutionary Database Design by Scott W. Ambler, Pramod J. Sadalage http://safari.oreilly.com/0321293533 T

Re: [Sqlalchemy-users] MySQL 4.1.11-debian: Commands out of sync; you can't run this command now

2006-09-19 Thread Sébastien LELONG
> are you folks on the latest MySQLDB ? I use MySQLdb version 1.2.1_p2, which is, as far as I know, the latest version. Which version is used when testing SA ? I've also noticed other types of SQL errors, such as "Lost connection to MySQL server during query" (which of course usually don't appe