Ticket #266 (closed defect: fixed)

Opened 19 years ago

Last modified 16 years ago

Deleting items from plural relationships are committed event when record not validated

Reported by: dhughes Owned by: somebody
Priority: highest Milestone:
Version: Severity: blocker
Keywords: Cc:

Description

If you have an object which as a plural/many to many relationship with another object, if you indicate that a related record should be deleted via your form post, the item is removed from the relationship even if the record does not validate.

This was a result of two things: 1) reactor wouldn't let you do deletes on an iterator in your own transaction and 2) the ModelGlue? GenericORMController didn't(couldn't) roll back transactions when validation failed. 3) the ModelGlue? ReactorAdaptor? didn't attempt (because it wasn't possible till now) to run delete related items in a transaction.

I've already implemented the fix needed in Reactor. Attached to this report is a new GenericOrmController? that uses cftransaction to manage the commit and validation.

What's changed is the cftransaction tag on line 130, a commit on 152, a rollback on 158 and the close cftransaction tag.

Also attached is a new ReactorAdaptor? (that includes fixes for tickets #265 and #264). This changes the call to the delete method on the iterator so that the useTransation argument is set to false (allowing us to use the one we started in GenericOrmController?.

Attachments

GenericORMController.cfc (7.2 kB) - added by dhughes 19 years ago.
ReactorAdapter.cfc (19.8 kB) - added by dhughes 19 years ago.

Change History

Changed 19 years ago by dhughes

Changed 19 years ago by dhughes

Changed 19 years ago by dhughes

Oh, I also added an argument to ReactorAdaptor?.commit that indicates if the save should be processed in a transaction. This defaults to false and is not required. This also supports this whole process.

Changed 19 years ago by joe.rinehart

  • status changed from new to closed
  • resolution set to fixed

(In [290]) Fixes #266, implementing transaction management in the GenericORMController, adding necessary arguments to the adapter API, and updating Reactor and Transfer adapter implementations as necessary.

Changed 16 years ago by cfgrok

  • milestone User Reported Issues (with full information) deleted

Milestone User Reported Issues (with full information) deleted

Note: See TracTickets for help on using tickets.