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
My opinion is that manual transactions require a try/catch i.e., you have the responsibility to react on errors/exceptions. We should clarify this in the documentation.
As minimum, we should clarify the documentation on the callers responsibility to cancel the transaction if any errors are thrown while interacting with it.
I still think this is a bug though. It should either throw or create the object with the properties. I believe its an (highly unexpected) artifact of the implementation that the database can be left in a state where the object is created, but without values for its properties.
Goals
Calls to
realm.create()
should either create an object or throw (while in a manual transaction).Expected Results
If
realm.create
throws, I expect no side-effects on the database (ie. no rows with default values created).Actual Results
Calling
realm.create
with missing values, while in a manual transaction throws but also creates an object with default values.Steps to Reproduce & Code Sample
☝️ throws
Listing the objects afterwards reveals an object was actually created:
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: