On Dec 31, 2007, at 4:40 PM, connie_codes wrote:
>
> I am using sqlalchemy-0.3.10 in conjunction with firebird.
> When trying to flush (inside a try loop) an object with a value which
> violates a unique constraint, i am getting a server error which
> amounts to:
> "<class 'sqlalchemy.exceptions.SQLError'>: (ProgrammingError) (-803,
> 'isc_dsql_execute: \n violation of PRIMARY or UNIQUE KEY constraint
> "INTEG_234" on table "USERS"')....
>
> I expect this error, that is why the dbsession.save(upd_usr) and
> dbsession.flush() are inside of a try/except loop.
>
> try:
> self.dbsession.save(c.cur_user)
> self.dbsession.flush()
> except :
> c.errors.append("failed adding/editing.....
>
>
that approach is just fine....to see whats going wrong take a look at
the line numbers in your stack trace, see if they match up as
expected...maybe the error is coming from somewhere else.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---