On Jul 18, 2006, at 1:12 PM, William K. Volkman wrote: > I agree that this is perhaps more of an application issue however > there is some logic that supports the idea that across multiple > applications the business logic should go into the database. > What I interpret him asking for is basically the effect of > autocommit. Where each interaction with the database takes > affect immediately, not as part of a unit-of-work. >
if your business logic is in the database then you probably wouldnt want to use an ORM ? usually this implies that you communicate to the DB via stored procedures. > What I suspect is the problem is that starting the session > flush, it runs down the set of objects making changes. > Then trips over one object that fails and stops. > How to identify that object to remove it from the list of > updates to be made and then re-initiate the flush so that > the remaining objects have their changes propagated? > This is a use case where transactions are not appropriate. yeah, this would supercede the usage of the unit of work pattern altogether, i think. if youre tacking on custom triggers and such to check business conditions, then the exceptions raised by those triggers should contain enough information in them that you can search through your object graph yourself to match up what object caused the error. im very hesitant to add more try/excepts all over the mapper, which have the effect of messing up stack traces, not to mention making the future addition of "batch mode" that much more impossible, without seeing specifically what use case we are talking about. if I did do this, then it might be a custom SQLAlchemyException which contained a reference to the object itself (and perhaps a lot of the exceptions that get raised right now based on object instances should actually contain references to the object). relying on repr() in the exception message itself is not particularly useful. ------------------------------------------------------------------------- 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