-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Releasing statement in a finalizer #1496
Milestone
Comments
its because it gets the statements when the parameters are less, thus not closing them. makes sense. for now you can patch this with:
then in |
in |
Merged
Thanks for the quick fix and for offering a workaround! I look forward to
the new release. 🙂
…On Dec 19, 2017 21:08, "Andrew Grosner" ***@***.***> wrote:
its because it gets the statements when the parameters are less, thus not
closing them. makes sense. for now you can patch this with:
public class ModelSaverFix<TModel> extends ModelSaver<TModel> {
@OverRide
public synchronized boolean ***@***.*** TModel model, @nonnull DatabaseWrapper wrapper) {
boolean exists = getModelAdapter().exists(model, wrapper);
if (exists) {
exists = update(model, wrapper, getModelAdapter().getUpdateStatement(wrapper));
}
if (!exists) {
exists = insert(model, getModelAdapter().getInsertStatement(wrapper), wrapper) > INSERT_FAILED;
}
if (exists) {
NotifyDistributor.get().notifyModelChanged(model, getModelAdapter(), BaseModel.Action.SAVE);
}
// return successful store into db.
return exists;
}
}
then in TableConfig specify it as the modelSaver() parameter.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1496 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdU5Sm7zA5tVikOeUveB7YhVND8YVE6ks5tCBengaJpZM4RG5iW>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are using DBFlow 4.2.1 and SQLCipher 3.5.7.
When we are saving model objects, these warning messages pop up.
We are passing the
databaseWrapper
to thesave()
method.The text was updated successfully, but these errors were encountered: