-
Type: Bug
-
Status: Resolved
-
Priority: Blocker
-
Resolution: Won't Fix
-
Affects Version/s: Android 2.0
-
Fix Version/s: None
-
Component/s: Android SDK
Connection pool issue accessing cache on Samsung S4 (Android 4.2.2)
I use nuxeo-android-connector-2.0-SNAPSHOT
The error on cache access (select, create, update,..)
10-20 23:51:41.989: W/SQLiteConnectionPool(15662): Connections: 0 active, 1 idle, 0 available. 10-20 23:51:42.069: W/SQLiteConnectionPool(15662): The connection pool for database '+data+data+org_gots+databases+NuxeoCaches' has been unable to grant a connection to thread 10794 (AsyncTask #3) with flags 0x1 for 2621.79 seconds. 10-20 23:51:42.069: W/SQLiteConnectionPool(15662): Connections: 0 active, 1 idle, 0 available. 10-20 23:51:45.983: W/SQLiteConnectionPool(15662): The connection pool for database '+data+data+org_gots+databases+NuxeoCaches' has been unable to grant a connection to thread 10798 (pool-1-thread-1) with flags 0x1 for 2637.0361 seconds. (... and so on in loop...)
The same issue occurred on my own code during test on this new device. I solved it with a database singleton access.
I tried to do the same on SQLStateManager but nothing changed.
private SQLStateManager(Context context) { super(context, DBNAME, null, VERSION); } public static SQLStateManager getInstance(Context context) { if (instance == null) { instance = new SQLStateManager(context); Log.d(TAG, "new instance"); } return instance; }
There is no exception and the application is waiting for asynctask end. My progress dialog is never dismissed. That means the doinbackground() is still running .
my async task looks like this
@Override protected void onPreExecute() { dialog = ProgressDialog.show(ProfileActivity.this, "", getResources().getString(R.string.gots_loading), true); dialog.setCanceledOnTouchOutside(true); // dialog.show(); super.onPreExecute(); } @Override protected List<GardenInterface> doInBackground(Context... params) { return gardenManager.getMyGardens(force_refresh); } @Override protected void onPostExecute(List<GardenInterface> myGardens) { force_refresh = false; try { dialog.dismiss(); dialog = null; } catch (Exception e) { // nothing } ... super.onPostExecute(myGardens); }
and the nuxeo request
DocumentManager service = session.getAdapter(DocumentManager.class); byte cacheParam = CacheBehavior.STORE; boolean refresh = force || force_force; if (refresh) { cacheParam = (byte) (cacheParam | CacheBehavior.FORCE_REFRESH); refresh = false; } Documents gardensWorkspaces = service.query( "SELECT * FROM Garden WHERE ecm:currentLifeCycleState != \"deleted\"", null, new String[] { "dc:modified desc" }, "*", 0, 50, cacheParam);