Deletion problems in Servoy 5.2.11

Hi

We have serious problems deleting records, which we didn’t have in 5.2.10. And: Our application will be productive in two weeks:

  1. We have a table courses and a table courseMembers. In courseMembers we store a foreign key to a course. The relation coursed_to_courseMembers does not allow parents to be deleted when having related records. If we “delete” a courseMember, we set the foreign key to null. But if a course is no longer referenced by any courseMember, we cannot delete the course. The relation coursed_to_courseMembers prevents the deletion. How can this be? Debugging this, shows us an empty foundset.

  2. Deleting a course will delete the teachers quota, assigned to the course as well (defined by a relation courses_to_quotas, where we defined that related records should be deleted as well). I think, deleting a course should be one transaction: Delete the course and the quota. If something fails, nothing is done. But: The quota is deleted even if course deletion fails. This is wrong in my opinion.

  3. Table event afterRecordDelete does not trigger (see http://www.servoy.com/forum/viewtopic.php?f=4&t=17391)

Servoy 5.2.11
Mac OS X 10.7.2
Java 1.6.0_29
SQLAnywhere12

Any help will be much appreciated. Regards

Its quite hard to understand everything what really happens
what do you exactly delete when. are you using database transactions and so on
Can you make a simple example based on those 2 tables? with that relation you have?

I try to make an example solution.

Hi Jan

Problem found! While building the example solution to let you reproduce the problems, I found the problem on my side :oops: At least for point 1 and 3. Sorry.

Point 1: The course could not be deleted, since it also tried to delete the next course (in time) with ‘delete related records’. But the course in the future had course members, which prevented the deletion.

Point 3: Even more easy: We do not really delete the course members, we just set a foreign key to null. I shouldn’t expect a table delete event to trigger on that, should I?

Point 2: Still open. I couldn’t reproduce it. But it is not key for us. The other two were the points we did worry about.

Thanks and regards