> this is a very serious issue !

Yes it is! All of a sudden all kinds of random records were being  
deleted in my app for no reason at all! Luckily it was just test data...

>   the fix for your test is pretty easy, when the lazy load  
> operation occurs, it has to make sure it sets up that "hasparent"  
> relationship properly on the newly loaded objects.
>
> but im still fixing it for eager loading, which currently bypasses  
> the attribute manager (that has to change).
>
> i am extremely glad you found this bug before I released.  because  
> look at the symptom:
>
>         m = mapper(User, users, properties={
>             'addresses':relation(Address, cascade="all,delete- 
> orphan", lazy=False)
>         })
>         mapper(Address, addresses)
>
>         s = create_session()
>         q = s.query(m)
>         user = q.get(7)
>         user.addresses[0].email_address='foo'
>         s.flush()
>
> because of our enhancement to the unitofwork to double-check for  
> orphans, this flush sees the "Address" object as an orphan and  
> deletes it !!!

Yes, that's exactly what I was seeing in my program. Its funny that I  
couldn't make a test to reproduce it since it's so easy to do now  
that we know how. Let me know when it's fixed. Thanks.

~ Daniel


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to