-
Notifications
You must be signed in to change notification settings - Fork 576
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
The Realm is already in a write transaction #6834
Comments
➤ PM Bot commented: Jira ticket: RJS-2882 |
It is difficult to tell as the functionality of Instead of |
Yes. We have a cached realm singleton globally. However, this instance will not be modified after it is created.
|
You could try to write your method to: public static saveTransaction(entity) {
const realm = RealmManager.getRealmInstance();
let inTransaction = realm.isInTransaction;
if (!inTransaction) {
realm.beginTransaction();
}
realm.create('Transaction', entity, UpdateMode.All);
if (!inTransaction) {
realm.commitTransaction();
}
} |
Do you mean we are able to reuse the current transaction? |
|
How frequently does the bug occur?
Sometimes
Description
context
We found the issue in realm 10.15.0 and
react-native
0.66.3 one year ago.After we upgrade
realm
to 12.6.2 andreact-native
to 0.72.12. We still can get these exceptions from logs in production.However, we can not repro it on our side. It's too bad.
We call the following method in a loop. I am not sure if it causes the issue.
errors on iOS 17.5.1
The exceptions happen frequently to the user, who is on iOS 17.5.1.
errors on other users
issue: The Realm is already in a write transaction
Also, there are a few error logs and they are all instantaneous in other Android and iOS users.
Stacktrace & log output
No response
Can you reproduce the bug?
No
Reproduction Steps
No response
Version
12.6.2
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
iOS 17.5.1
Build environment
Which debugger for React Native: ..
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: