Skip to content
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

Issue with Database Operations in Android Application #2522

Open
ukrrrish opened this issue Mar 7, 2024 · 3 comments
Open

Issue with Database Operations in Android Application #2522

ukrrrish opened this issue Mar 7, 2024 · 3 comments

Comments

@ukrrrish
Copy link

ukrrrish commented Mar 7, 2024

Hi Team,
We are encountering a challenge with database operations in our Android application.

In our application, we utilize the following pseudocode logic for performing database queries:
val queryString = "SELECT {Example__c:_soup} …….”
store.query(QuerySpec.buildSmartQuerySpec(queryString, 10_000), 0)


We have observed that when executing complex queries on one screen and subsequently navigating to another screen where a similar query for the same database table Example__c is triggered, there is a noticeable delay in executing the latest query.
Our suspicion is that the database table Example__c may be locked, causing the new operation to be executed only after the completion of the previous one.
In light of this, we are seeking your expertise to provide suggestions or guidance on how we can potentially address this issue. Specifically, we would like to explore the possibility of canceling the existing table query operation before initiating a new one.
We would greatly appreciate any insights or recommendations you can provide to help us resolve this matter efficiently.

Also we have observed that, in comparison to iOS, SyncDown operations in our Android application are taking longer to complete. Our implementation follows the architecture outlined in the SalesforceMobileSDK-Templates repository: https://github.com/forcedotcom/SalesforceMobileSDK-Templates/tree/dev/MobileSyncExplorerKotlinTemplate

Could you suggest if there is a more efficient approach to implement SyncDown operations in Android?

@wmathurin
Copy link
Contributor

What version of the Mobile SDK are you using?

@nzsrini
Copy link

nzsrini commented Mar 7, 2024

SDK v11.1.0
@wmathurin we got two challenges over there.

  1. Local Query SmartSoup SOQL is in process of the fetching the data on one Screen (Screen1), the user switches to a different screen (Screen2) and the new screen(Screen2) also tries to access the same table ,we are observing the performance issue .we think either the issue is with Local Query waiting complete first Query in Screen1 . Is there any way we can cancel the Execution in Screen1?

  2. Data download from Salesforce--- we observed for example IOS : take 50 seconds to download data and on Android it is taking around 1.40 - 2 mins.

Any suggestions or recommendations would be helpful.
**Same team. **
Thanks,

@wmathurin
Copy link
Contributor

Until SQLCipher 4.5.5 , SQLCipher for Android did not support concurrent database access. We have recently upgraded to that version in dev (it will be in Mobile SDK 12.0) but we have not yet relaxed concurrency in the SmartStore code itself. We plan to get to it but it will probably not be part of MSDK 12.0. When we do that, it should address the kind of challenges you have observed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants