You need to make sure that you are closing your sessions--otherwise,
they keep your connections open, and are never returned to the pool.
Make sure to read up on sessions here:
http://www.sqlalchemy.org/docs/05/session.html
Also, read up on logging:
Definitely go with middleware--it's very clean and simple. Also, make
sure to use sqlalchemy.orm.scoped_session()--it makes using sessions
in Django pretty much transparent; any time you need to work with a
session, you call Session(), and it either uses your current one, or
creates a new one if
*sess* a keywork parameter, that's really
clever!
Thanks a lot!
On Mar 11, 9:05 pm, Jeff FW jeff...@gmail.com wrote:
Logging SA objects *after* the session is gone will always be a
problem, unless you make sure to detach all of them from the session.
I'd just log the original
am, Jeff FW jeff...@gmail.com wrote:
That's pretty similar to what I do, actually, if a bit simpler (but
that's good!) One suggestion would be to throw an except (maybe for
the base SQLAlchemy exception class) in your try block, otherwise you
run the risk of things dying in an ugly way
Don't use scoped_session--you'll run into problems no matter what you
do. I'm using Perspective Broker from Twisted with SQLAlchemy. I
make sure to create and commit/rollback a session for *every* PB
request. It works perfectly, and that's the only way I was really
able to get it to work in
Hi guys,
I have an application running under 0.4.7p1 It access a MSSQL server
using pymssql. Now I am trying to see if I can port it to 05 and use
pyodbc (2.1.4).
I am experiencing a strange problem.
I have defined some custom column types (see below) to deal with some
legacy database.
throughout 0.4). Check out the third bulletpoint here:
http://www.sqlalchemy.org/trac/wiki/05Migration#SchemaTypes
On Jan 12, 2009, at 10:29 PM, fw wrote:
class IntString(sa.types.TypeDecorator):
A string type converted between string and integer
impl = sa.types.String
def
Thanks,
That seems to solve the problem.
Cheers,
François
Rick Morrison wrote:
Thanks for your continuing interest in my silly problem
It's not a silly problem, it's a important fundamental operation that ought
to work correctly!
Try the attached patch against pymssql 0.8.0.
Hi Rick,
Thanks for your continuing interest in my silly problem
Rick Morrison wrote:
How are you deleting the rows? Is this via Session.flush(), or an SQL
expression statement?
Via a session commit/flush
Please post some code as to how you're trying this...
The code goes something
Hi Guys,
I have an application that staddles 2 databases, MySQL and MS-SQL.
It is working but could be faster. To that end, I am trying to use MS-
SQL with the pymssql module (so I can eagerload a number of things).
The problem is that DELETE fail when more than one record is deleted.
It
:]]))
File sqlalchemy/types.py, line 208, in __getattr__
return getattr(self.impl, key)
AttributeError: 'String' object has no attribute 'padding'
Cheers,
François
On 13 nov, 22:17, Michael Bayer [EMAIL PROTECTED] wrote:
On Nov 13, 2007, at 2:51 AM, fw wrote:
Hi,
I am having a weird
no attribute 'mapper'
On 13 nov, 23:23, jason kirtland [EMAIL PROTECTED] wrote:
fw wrote:
Hi,
I am having a weird problem. I am dealing with some legacy database,
so I subclass TypeDecorator to help clean things up a bit.
This worked fine in 0.3 but I am now trying to use 0.4 and things
break
Hi,
I am having a weird problem. I am dealing with some legacy database,
so I subclass TypeDecorator to help clean things up a bit.
This worked fine in 0.3 but I am now trying to use 0.4 and things
break in the strangest of way.
When I run the file below, Python complains about
Hi,
I have the weirdest of problem. When using mssql, INSERT (via a
session flush) in one of my table fail, but there is no error
description in the exception (None)
The program seems to be alright since when I associate that table (and
the Inventory table) with a mysql connection, things work
Thanks Rick,
I updated to the latest SVN rev and things do work now.
Cheers,
François
On Apr 4, 10:08 pm, Rick Morrison [EMAIL PROTECTED] wrote:
Hi fw,
The explicit zero for the
float column was a bug that should be fixed in rev #2491.
MSSQL can store low-resolution datetimes
)
and use MakerCost instead of Cost as the attribute, it
works fine
It seems to me that the renaming of attributes vs. column name has
some issue.
It is easy to work around it in any case.
Cheers,
François
On Apr 4, 10:08 pm, Rick Morrison [EMAIL PROTECTED] wrote:
Hi fw
Hi,
I am using version 0.2.8 with Python 2.4.3 and MySQL 4.1.21 on an
up-to-date Linux Gentoo box
I am having a problem with session.flush(). It seems that every time I
issue a session
flush the DB connection is closed. If I do something like this
eng =
create_engine('mysql://test:[EMAIL
17 matches
Mail list logo