-
Notifications
You must be signed in to change notification settings - Fork 467
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
[Android] Cannot perform this operation because there is no current transaction #800
Comments
Hey, could you please provide move info? What code you use/when? Do you have repro steps? |
Hi @krizzu. Sorry - we don't have any repro steps at all. We use RNAsyncStorage alongside apollo-cache-persist, and this tends to be where we're seeing the error reported:
Probably not massively interesting, but for context our instanciation of apollo-cache-persist:
Apollo Cache Persist interacts using |
Are you using Next storage implementation? If not, I might suspect that this would happen if you db would be accessed after Activity is destroyed (app is about to close). We have this code in on host destroy, which was placed there to fix other issue |
I'm not sure what you mean by this - sorry. |
There's this feature to use different driver for storage (Android only, more details here) |
Ah, thank you. |
In that case, my suspect would be to what I already said above
Can't really tell why/when apollo does storage flush, but maybe it's on going to background? |
Yeah - that sounds sensible. |
I have same issue only with react-native-async-storage. I have implemented even next storage, but it didn't help. The way to reproduce is next: try to open and close your app 3-7 times(at startup must be implemented async storage) and you will get Error storing data [Error: Cannot perform this operation because there is no current transaction.] System info:
gradle.properties:
|
Can you please add specific code + where you want it? index.js / App component etc. |
|
I've added this code to
Quickly closing the app with back button and re-opening it on Android 9 immediately leads to error. Here is the actual error that is visible in logs before facing with
|
@krizzu Any thoughts on post from @storm2513 above? |
This issue has been marked as stale due to inactivity. Please respond or otherwise resolve the issue within 7 days or it will be closed. |
unstale |
@tido64 Is the |
Facing this issue as well, when this error occurs my token gets wiped out from async storage and app logs out, anyone facing this issue? |
This comes down to using SQLite in a proper manner. The Resulting
With that code on app launch + kill/restart app like that will get you errors. The original error was about trying to access the database, while the connection was already closed. DB connection is closed when This has been fixed in
@haroon-cb hey, you'll have to be a bit more specific - would be perfect to get a repo when issue can be reproduced 🙏 |
We are unable to reproduce the issue, what we are doing is that we are storing our auth token in async-storage. We are using redux-persist to persist data in async storage. When we do an interaction that writes the data in redux-persist we get this error and app restarts and the token gets removed from async storage and thus the user logs out. We are using realm as a database and redux-persist as persistence layer. Is this issue same as faced above by @ball-hayden? P.s: We are not using next storage implementation yet. The versions we are using: |
Very similar I think @haroon-cb - we're using |
@haroon-cb I'd still need more info to find what's happening.
You're using
so issue happens anytime you send an action? @ball-hayden |
We are using Async Storage directly to store the token and then using redux persist to store the application data that we want to persist. I don't think so that's there is issue due to same keys. Yes it happens anytime we send an action. But it happens randomly, we were only able to reproduce it once. It's been months this issue is occuring, but no solution found. @krizzu |
I haven't been able to try |
@haroon-cb That'd require a bit more investigation then. I don't know your setup and I don't want to shoot blanks here, so if you could provide more info, I might be of help. |
We have decided to implement next storage, will update if this issue resolves after using the next storage implementation. |
We're experiencing same issue and applied next storage as it was suggested above. This change had lead to a noticeable spike in errors number on app start: |
@MarySnopok Seems like you run into linkage error. From a small research I conducted just now, class ProcessLock was added in version 2.3.0 of You can confirm that by running You can try to bump Room version, as described in docs here., to 2.5.0, which includes |
What happened?
Error reporting shows the following message:
Version
1.17.3
What platforms are you seeing this issue on?
System Information
Steps to Reproduce
Unable to reproduce.
The text was updated successfully, but these errors were encountered: