[Sqlalchemy-tickets] [sqlalchemy] #1232: When having a primary join that is created from two fields
Brought to you by:
zzzeek
#1232: When having a primary join that is created from two fields, adding multiple entries to that table using orm that are the same in those two fields doesn't raise a constraint error --------------------+------------------------------------------------------- Reporter: guest | Owner: zzzeek Type: defect | Status: new Priority: medium | Milestone: Component: (none) | Severity: no triage selected yet Keywords: | Status_field: awaiting triage --------------------+------------------------------------------------------- This problem occurs in sqlalchemy 4.7.1, using oracle 9. Case scenario: I had a job table, and a task task, and a jabs2tasks table to create a many to many relation. I created a job and a task, and added the job twice to the task (using a relation that have a secondary). len(task.jobs) returned 2. Then I saved the task and commited. I was expecting that an exception would be thrown, but it didn't. When I looked in at jobs2tasks in my SQLNavigator, I saw that only one entry was enetered. The problem is, that this behaviour is not expected. When I try to enter, for example, a task that already exists in the db (the same task_id), sqlalchemy throw a constraint exception. I think that this is exactly the same case, but with a complex primary key. Reported by Kobi Perl. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1232> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |