On Tue, 18 Jul 2006 08:32:05 -0700, Michael Bayer <[EMAIL PROTECTED]> wrote:
> > On Jul 18, 2006, at 9:52 AM, Charles Duffy wrote: > >> Anyhow, as I was saying, it looks like it should be possible to attach >> the object to the exception in Mapper.save_obj() so you can find out >> which object the issue is related to. The component of what you >> suggested I have serious concerns about is having SQLAlchemy remove >> the >> object which is causing the error from the session (and then commit >> the >> rest), since committing anything in the presence of an error is >> frequently a Bad Thing and is only reasonable behavior if explicitly >> intended. > > obviously we're not having SA do anything with the session if a flush > () fails; that would be up to a programmer to define whatever error- > handling action should occur at that point. progammers being lazy by default ;-), doesn't an invalidation of the session state by default cater to easier usage? given that currently the offending object isn't handed back to programatic control, its hard to see how the application can do meaningful recovery from a failed state, outside of clearing the session and extant object references. perhaps i'm being naive or misunderstanding, either as to what are other sort of options are open to the application, or what sa is actually doing, but baring that shouldn't an exception state in sa by default rollback the objects in the session and clear the session state to have easier usage? for explicit progamming modes the existing do nothing wrt session behavior by default can be preserved by sa.mods, else all sa users are forced/required to come up with their app specific error handling. if thats the best case, then scenario examples/concepts in the docs would be welcome. -kapil ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users