On Oct 1, 12:54 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> Any extension, mapper or session, can cancel the operation overall by raising 
> an exception, which will result in halting the flush and issuing a ROLLBACK.  
>  Usually, if something goes "wrong" inside of a transaction, the whole thing 
> is rolled back since you otherwise have only a partial state of data.
>
> Inside of mapper extension, a simplistic "dont update the row" operation may 
> be possible if you just expired the attributes of the instance inside of 
> before_update(), though I haven't tried this and it wouldnt really work for 
> inserts or deletes anyway.
>
> Within session extension, its common to search for objects by traversing 
> through the .new, .dirty and .deleted collections.     0.7 will be expanding 
> on this model by providing event listener hooks that do this filtering for 
> you, sending only objects of the desired type to the listener, and from that 
> it follows that we can eventually optimize the search by improving the 
> bookkeeping performed by these collections.    SessionExtension is definitely 
> the more generic choice overall these days for flush events.   the use cases 
> for MapperExtension are much smaller.


Sounds good. I suppose I would most often raise an exception to
rollback the entire flush, but in rare cases I might want to go ahead
and save the rest of the object I would just detach one from the
session and delete it.

Thanks for you reply,

Landreville

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to