Using echo=True can be helpful for programmers in identifying what
happened. But for a program to to so can be difficult.
It is also difficult to add all check conditions and constraints
current programmed as foreign keys, triggers etc. in the database
itself. Since the database can be accessed by multiple applications,
it seems to be logical to leave these checks in the database itself
instead of building them all into all these applications.
So if the database catches some checks that the application doesn't,
it refuses to make the changes. But the application simply receives an
exception without knowing which object is cause the error. It can pass
the error message to the user. But since the object is still in the
dirty cache of the session, the same defect data may be submitted to
database again at next flush().
One possibility is to clear the session cache, which however would
mean other valid changes would also be clear out and got lost.
Therefore I would like SA to inform the application which is the
object that caused the current SQL exception and then remove the
specific object from the session so that other changes would get
committed to database.
On 7/18/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
use echo=True on the SQL is one way. depends on the error, there can
be more pre-flush checks added if they are reasonable.
--
Hong Yuan
大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
-------------------------------------------------------------------------
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