Menu

#100 SQLException when deleting a player from an association

TM4J 0.9.4
closed-fixed
5
2004-06-19
2004-06-18
Andy Peel
No

I'm getting this when trying to remove a topic that is
a player in an association:

java.sql.SQLException: ERROR: update or delete on
"tmobjects" violates foreign key constraint
"fk61e7b90dc6f0e22b" on "member_players"

I was expecting it to be a TMAPI TopicInUseException or
at least a TM4J IntegrityViolationException.

Looking at the destroy method in the Hibernate
TopicImpl, and bearing in mind that I'm not familiar
with the TM4J schema, it doesn't seem to do a check for
this case.

Kal thinks this might be a missing rule from the
Hibernate backend.

Discussion

  • Kal Ahmed

    Kal Ahmed - 2004-06-18
    • assigned_to: nobody --> kal_ahmed
    • status: open --> open-accepted
     
  • Kal Ahmed

    Kal Ahmed - 2004-06-18

    Logged In: YES
    user_id=176992

    Validated with a new unit test.

     
  • Kal Ahmed

    Kal Ahmed - 2004-06-18
    • status: open-accepted --> pending-fixed
     
  • Kal Ahmed

    Kal Ahmed - 2004-06-18

    Logged In: YES
    user_id=176992

    Code now checks that the topic does not play any roles
    before trying to destroy it.

     
  • Andy Peel

    Andy Peel - 2004-06-19
    • status: pending-fixed --> closed-fixed
     
  • Andy Peel

    Andy Peel - 2004-06-19

    Logged In: YES
    user_id=1064816

    Works a treat. Thanks.

     

Log in to post a comment.