You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
I'm in the midst of building out an adapter for data mapper and am running into an issue where create reports that a save is successful even though the save failed.
according to the documentation in abstract adapter, create should return the number of records that were actually saved to the datastore. however, this value is ignored and the save is assumed to be succesful as long as the attributes on the DataMapper::Resource are valid at the time it is to be persisted.
create_resource eventually calls the adapter's create method but this value is discarded. so in the case that the create fails, it still reports back as saving successfully.
i'd assumed that the return value was so that you could check that all records were successfully persisted. you could raise an exception from the adapter, but that seems pretty heavy-handed.
what would the "data_mapper" of handling this situation be? perhaps, returning the transient persistence state or another persistence state to indicate the create had failed but would allow for a normal retry as desired?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm in the midst of building out an adapter for data mapper and am running into an issue where create reports that a save is successful even though the save failed.
according to the documentation in abstract adapter, create should return the number of records that were actually saved to the datastore. however, this value is ignored and the save is assumed to be succesful as long as the attributes on the DataMapper::Resource are valid at the time it is to be persisted.
this is the block of code in question:
create_resource eventually calls the adapter's create method but this value is discarded. so in the case that the create fails, it still reports back as saving successfully.
i'd assumed that the return value was so that you could check that all records were successfully persisted. you could raise an exception from the adapter, but that seems pretty heavy-handed.
what would the "data_mapper" of handling this situation be? perhaps, returning the transient persistence state or another persistence state to indicate the create had failed but would allow for a normal retry as desired?
The text was updated successfully, but these errors were encountered: