[sqlalchemy] Re: Weakly-referenced object error

2007-06-03 Thread Mike Orr
No weak-reference error for three days now so it looks like the MySQLdb upgrade cured it. Curious because I've been running other sites sites with that same older version and never gotten that error. But this is the first site that's mulththreaded (Pylons rather than Quixote) so I bet that had

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Michael Bayer
the latest version of MySQLDB does use weakrefs right at the heart of things, in connections.py and cursors.py.since we are catching the exception we cant see the full original stack trace but its possible that it would trace into mysqldb's source code. that doesnt rule out that we are doing

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Mike Orr
On 6/1/07, Michael Bayer [EMAIL PROTECTED] wrote: the latest version of MySQLDB does use weakrefs right at the heart of things, in connections.py and cursors.py.since we are catching the exception we cant see the full original stack trace but its possible that it would trace into

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Michael Bayer
On Jun 1, 2007, at 2:23 PM, Mike Orr wrote: Why can't SQLAlchemy catch this and the gone-away error, refresh the connection, and redo the query like SQLObject does? That's really what one wants, not a pool_recycle time. I think you said that's incompatible with transactions but I don't

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Mike Orr
No weak-reference error this morning, hooray. I'll be watching it for a few days. Could using a BoundMetaData in my model be contributing to the problem? I have the following structure: === ctx = get_session_context() # A custom function that creates a session_context like #

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Michael Bayer
On Jun 1, 2007, at 7:22 PM, Mike Orr wrote: No weak-reference error this morning, hooray. I'll be watching it for a few days. Could using a BoundMetaData in my model be contributing to the problem? I have the following structure: i cant see how. all of that code internally uses

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Mike Orr
On 6/1/07, Michael Bayer [EMAIL PROTECTED] wrote: Mike Orr wrote: Could we have session.engine be an alias for session.bind_to? Pretty please? The only reason I leave a top-level 'engine' around is in case I need it for something, because .bind_to is so non-obvious. pylons is the

[sqlalchemy] Re: Weakly-referenced object error

2007-06-01 Thread Mike Orr
On 6/1/07, Michael Bayer [EMAIL PROTECTED] wrote: pylons is the reason pulling the engine off the session is even becoming popular, because it is actually using the bind_to feature, as well as that it didnt really create any easy way to get at the engine repository (not to mention the issues

[sqlalchemy] Re: Weakly-referenced object error

2007-05-31 Thread Mike Orr
On 5/31/07, Mike Orr [EMAIL PROTECTED] wrote: I've been getting this on my Pylons site. sqlalchemy.exceptions.SQLError: (ReferenceError) weakly-referenced object no longer exists In case it helps, the exception occurs at sqlalchemy/engine/base.py line 583 (SQLAlchemy 0.3.7):

[sqlalchemy] Re: Weakly-referenced object error

2007-05-31 Thread Michael Bayer
nothing is weakly referenced within the block where that exception is being thrown. the only place weakrefs are used outside of the ORM is a couple of dictionaries in pool.py. you havent said what reproduces this problem ? you just start the app, and it happens every time ? On May 31, 6:01

[sqlalchemy] Re: Weakly-referenced object error

2007-05-31 Thread Mike Orr
It happens only when the site has been idle for several hours; i.e. overnight. Once it starts it keeps happening every request until I restart the application. The first time it happened, somebody had gotten a MySQL server has gone away error during the night, followed by a couple