Hi,
I'm using Catalyst along with DBIC, and I recently got this error:

DBIx::Class::ResultSet::create(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`WebStmt/users_roles`, CONSTRAINT `users_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)) [for Statement "INSERT INTO users_roles ( role_id, user_id) VALUES ( ?, ? )" with ParamValues: 0='HASH(0xb57f080)', 1='66'] at /home/steve/Catalyst/WebStmt/script/../lib/FSUstmt/Controller/WebUsers.pm line 109

The interesting thing is that even though this error was thrown, the insert worked.  The use case is simply that I've just created a new 'User', and I now want to give that user a 'Role'.  I'm using a join table to do so.  That table has the id's of both the User and Role(s) associated.

Is this a bug?  The problem I have is that even though the insert works, it blows up my Catalyst application.

Thoughts?

<<attachment: steve.vcf>>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to