On Sun, Mar 6, 2011 at 5:21 PM, Michael Bayer wrote:
>
> On Mar 6, 2011, at 8:16 PM, Lenza McElrath wrote:
>
> Ok cool. I actually could write my code to produce exactly that effect
> fairly quickly since I was already accessing the mutable object through a
> comparable_pro
explaining that attribute
values are loaded individually once they are expired? Could the
resurrecting of state not be happening properly when only loading a single
attribute?
On Fri, Mar 4, 2011 at 2:16 PM, Michael Bayer wrote:
>
> On Mar 4, 2011, at 5:09 PM, Lenza McElrath wrote:
>
> &g
Thanks for the quick response to this as usual. See me responses below.
On Fri, Mar 4, 2011 at 7:32 AM, Michael Bayer wrote:
>
> On Mar 4, 2011, at 2:58 AM, Lenza McElrath wrote:
>
> Hello! I'm iterating over a session to look at all the objects:
>
> for obj in session
Hello! I'm iterating over a session to look at all the objects:
for obj in session:
do_something_cool(obj)
Yesterday this caused what looks like a deadlock in SQLAlchemy code. Here
is the stack I grabbed using gdb:
1. /python2.5/sqlalchemy/orm/session.py:1353 (Session.__iter__)
2. /pyt
Hey Royce,
This sounds like a job for composite columns:
http://www.sqlalchemy.org/docs/orm/mapper_config.html#composite-column-types
One gotcha that I ran into here is that you cannot have both the component
columns and the composite column mapped at the same time, like you do in
your example.
I am writing a system where I want my DB primary keys to be represented in
the system by a type other than an integer. I have run into several issues
with this:
1) I tried using a TypeDecorator, but SQLAlchemy does not like this. Seems
like the main problem is the auto_increment is not set on th
I ran into an issue where a query was returning a object where the relations
were stale. It turned out that this is because inserting a row does not
update relations in identity map. The basic issue looks like this:
my_model = MyModel()
session.add(my_model)
session.flush
such - see if cursor.rowcount
> is zero when it should be one. If I think of something else I'll let you
> know.
>
> On Nov 5, 2010, at 9:41 AM, Lenza McElrath wrote:
>
> Here is my output. Note that my updates are for "0.2" not
> "0.44
y/orm/unitofwork.py",
line 448, in execute
uow
File "/var/lib/python-support/python2.5/sqlalchemy/orm/mapper.py", line
1852, in _save_obj
(table.description, len(update), rows))
sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table
'sqlalchemy_test_my_model' exp
Well, turns out that it doesn't take much of a pool at all to get the test
to fail: http://pastebin.com/trHhiG47
On Thu, Nov 4, 2010 at 10:33 PM, Lenza McElrath wrote:
> Interesting. When I use your simple engine I do not get the error either,
> but I definitely get it when us
is higher percision than the DB can represent. It works when I use an
Integer type, or when test_value is 44 or 0.44.
Thanks for your help!
On Thu, Nov 4, 2010 at 6:18 PM, Michael Bayer wrote:
>
> On Nov 4, 2010, at 8:17 PM, Lenza McElrath wrote:
>
> I am getting a StaleDataError when u
I am getting a StaleDataError when updating a Float column to the same value
twice in a row. This happens because SQLAlchemy thinks that I am changing
the value, but then the DB reports that no value was changed.
Test case can be seen here: http://pastebin.com/vxFBAMxm
Is there an easy way aroun
passes.
-Lenza
On Mon, Oct 25, 2010 at 10:33 AM, Michael Bayer wrote:
>
> On Oct 25, 2010, at 1:07 PM, Lenza McElrath wrote:
>
> I am running into a issue where it looks like SQLAlchemy is not performing
> the proper DB update when committing a session after modifying an object.
I am running into a issue where it looks like SQLAlchemy is not performing
the proper DB update when committing a session after modifying an object.
This happens only when all references to the updated object are lost, and I
update a mutable attribute BEFORE updating another attribute. It seems as
14 matches
Mail list logo