-
Notifications
You must be signed in to change notification settings - Fork 17
Android, fix crash. Avoid concurrent execute update cursor in Sqlite #973
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…se in Android when autocommit is on (NoIntegrity).
Cherry pick to beta success |
1 similar comment
Cherry pick to beta success |
Cherry pick to beta success |
Cherry pick to beta success |
@jotapeg necesito el review de este PR para bajar a Stable para el proyecto novartis |
jotapeg
approved these changes
Jun 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apruebo para no bloquear, pero si se pueden responder esas dudas, mejor. Gracias
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Crash en app de Novartis con Sqlite en proc getpages2
https://issues.genexus.dev/viewissue.aspx?204648
Solution
Use ReentrantLock to avoid concurrent execute cursor in SqLite database in Android when autocommit is on (NoIntegrity).
This avoid crash that occurs with postExecute commands, like :
2025-05-20 09:44:45.657 6142-6536 AndroidRuntime com.novartis.pharma.drarthur.ext E FATAL EXCEPTION: pool-2-thread-2
Process: com.novartis.pharma.drarthur.ext, PID: 6142
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.database.CursorWindow.getNumRows()' on a null object reference
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:154)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:140)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:232)
at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:271)
at org.sqldroid.SQLDroidResultSet.first(SQLDroidResultSet.java:113)
at org.sqldroid.SQLDroidConnection.changedRowsCount(SQLDroidConnection.java:520)
at org.sqldroid.SQLDroidPreparedStatement.execute(SQLDroidPreparedStatement.java:221)
at org.sqldroid.SQLDroidPreparedStatement.executeUpdate(SQLDroidPreparedStatement.java:251)
at com.genexus.db.driver.GXPreparedStatement.executeUpdate(GXPreparedStatement.java:308)
at com.genexus.db.UpdateCursor.postExecute(UpdateCursor.java:41)
at com.genexus.db.DataStoreProvider.execute(DataStoreProvider.java:262)
at com.genexus.db.DataStoreProvider.execute(DataStoreProvider.java:169)
at com.novartis.gtm.getpages2.S111(getpages2.java:191)
at com.novartis.gtm.getpages2.privateExecute(getpages2.java:125)
at com.novartis.gtm.getpages2.execute_int(getpages2.java:117)
at com.novartis.gtm.getpages2.execute(getpages2.java:97)
at com.novartis.gtm.getpages2.execute(getpages2.java:42)
at com.genexus.android.core.layers.LocalProcedure.execute(LocalProcedure.java:78)
at com.genexus.android.core.actions.CallGxObjectAction.runGxObject(CallGxObjectAction.java:123)
at com.genexus.android.core.actions.CallGxObjectAction.Do(CallGxObjectAction.java:82)
at com.genexus.android.core.actions.CompositeAction.Do(CompositeAction.java:173)
at com.genexus.android.core.actions.ActionExecution$2.doInBackground(ActionExecution.java:368)
at com.genexus.android.core.actions.ActionExecution$2.doInBackground(ActionExecution.java:360)
at com.genexus.android.core.utils.TaskRunner.lambda$executeOnExecutor$2(TaskRunner.java:23)
at com.genexus.android.core.utils.TaskRunner$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)