[sqlalchemy] Re: transaction deadlock in sqlalchemy connection transactions

2007-07-15 Thread SamDonaldson
, Sam. On Jul 15, 7:09 pm, SamDonaldson <[EMAIL PROTECTED]> wrote: > I see the problem here. So what you're saying is that I need some way > of knowing what the parent connection object was to pass through the > decorators and the execute for the nested txn's sh

[sqlalchemy] Re: transaction deadlock in sqlalchemy connection transactions

2007-07-15 Thread SamDonaldson
n kirtland <[EMAIL PROTECTED]> wrote: > SamDonaldson wrote: > >[...] > > I have defined a transaction decorator: > > def transaction(func): > > def do(*args, **kw): > > connection = engine.connect() > > transaction = connection.begin() &g

[sqlalchemy] Re: Problem with sqlalchemy and mysql

2007-07-15 Thread SamDonaldson
a way? If anybody knows how to do this then let me know on mysql 5.0 sam On Jul 15, 3:33 pm, SamDonaldson <[EMAIL PROTECTED]> wrote: > Ok. This did not work and I dug this thread where you had a > discussion on this. It seems like this was fixed in sqlalchemy and > you were cal

[sqlalchemy] Re: Problem with sqlalchemy and mysql

2007-07-15 Thread SamDonaldson
other suggestions on how to fix this? Using MySQL 5.0.27 and sqlalchemy 0.3.8. Thanks. Sam On Jul 14, 11:07 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Jul 15, 1:02 am, SamDonaldson <[EMAIL PROTECTED]> wrote: > > > Not to ask to many questions here but isn't there

[sqlalchemy] transaction deadlock in sqlalchemy connection transactions

2007-07-15 Thread SamDonaldson
Hello, I'm running into a hang case on issuing an INSERT to mysql. Here's some code. Note that I don't really use sqlalchemy sessions or query objects or anything, I've written my own...I'm only using sqlalchemy for connection management. So in some file foo.py, I have the following: All of t

[sqlalchemy] Re: Problem with sqlalchemy and mysql

2007-07-14 Thread SamDonaldson
8:14 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > use the pool_recycle argument as described here: > > http://www.sqlalchemy.org/trac/wiki/ > FAQ#MySQLserverhasgoneawaypsycopg.InterfaceError:connectionalreadyclosed > > On Jul 14, 2007, at 8:15 PM, SamDonaldson wrote: >

[sqlalchemy] Problem with sqlalchemy and mysql

2007-07-14 Thread SamDonaldson
Hello group, I'm having an issue with my site where I get the following error if I don't use the site for a while, even just a few hours, like 2-3 hours results in: Error - sqlalchemy.exceptions.SQLError: (OperationalError) (2006, 'MySQL server has gone away') 'SELECT ...' {...} Does anyb

[sqlalchemy] last_inserted_ids() not initialized and not an attribute problem

2007-07-08 Thread SamDonaldson
Hello, I'm having trouble with the last_inserted_ids() function. I'm running an insert sql string as opposed to using the built in function. I thought I should be getting a resultproxy back and then I should be able to apply the last_inserted_ids function to get back the inserted id. Why doesn

[sqlalchemy] Re: Connection management in Sqlalchemy.

2007-07-05 Thread SamDonaldson
l Bayer <[EMAIL PROTECTED]> wrote: > On Jul 4, 10:22 pm, SamDonaldson <[EMAIL PROTECTED]> wrote: > > > I want to use MetaData() to return an object passed in it is the db > > uri. I want the connection object returned back to me from the meta. > > > meta =

[sqlalchemy] Re: Connection management in Sqlalchemy.

2007-07-05 Thread SamDonaldson
Yes, Is there a way to get to that chapter? Thanks, Sam. On Jul 4, 9:30 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Jul 4, 10:22 pm, SamDonaldson <[EMAIL PROTECTED]> wrote: > > > I want to use MetaData() to return an object passed in it is the db > > uri.

[sqlalchemy] Connection management in Sqlalchemy.

2007-07-04 Thread SamDonaldson
Hello, I wanted an in-depth understanding of what goes on in connection management in sqlalchemy. I want to use sqlalchemy for it's connection management but I'm planning on building my own custom orm. I just can't deal with assign_mapper and the stuff that goes on underneath the covers. I've b

[sqlalchemy] Re: major help required with SQLAlchemy and Turbogears.

2007-07-02 Thread SamDonaldson
. Moving to pylons now. Sam. On Jun 30, 3:36 pm, "Noah Gift" <[EMAIL PROTECTED]> wrote: > On 6/30/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > > > > On Jun 30, 4:41 pm, SamDonaldson <[EMAIL PROTECTED]> wrote: > > > I wrote a custom q

[sqlalchemy] Re: major help required with SQLAlchemy and Turbogears.

2007-06-30 Thread SamDonaldson
Hi, I solved this problem, by doing this: sqlalchemy.clear_mappers() I don't know why this solved the problem. Let me give you the gist of how I lead up to this problem: I wrote a custom query and selected a few columns out of a table. I then wanted to 'instantiatize' it so that i could refe

[sqlalchemy] major help required with SQLAlchemy and Turbogears.

2007-06-29 Thread SamDonaldson
I wrote my own custom update statement. It's a simple update statement, When I run the update on mysql, I get the result as expected, i.e., the table is emtpy, so no rows affected, nothing done. When I run it in my Tg script, it runs once, and boom, it stalls on this: result = turbogears.databa

[sqlalchemy] session issues in TG - automatic commits happening.

2007-06-22 Thread SamDonaldson
Ok, so let me explain the problem we're facing. I'm using turbogears with sqlalchemy. I run a custom query by supplying the SELECT string to the engine and then execute() that. It returns back a list of tuples. I'd like it to return a bunch of instances of A but I can't seem to find the api to

[sqlalchemy] checking the sql string.

2007-05-27 Thread SamDonaldson
How do I look to see what sql is being constructed in the query object? So if I have something like: q = query.session(User) q = q.add_column() q = q.group_by(.).select() How do I check what sql string has been constructed in q? Also, say I want to do a group by a particular column nam

[sqlalchemy] sqlalchemy and running custom sql.

2007-05-27 Thread SamDonaldson
I'd like to be able to run a custom query without having to use any of the ORM stuff. I'd like to pass in a sql query string to some API that returns back to me instances (it'd be great), or tuples. How do I do this? Thanks. --~--~-~--~~~---~--~~ You received t