Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid eclipse error with close/open SQLite database
    primarykey
    data
    text
    <p>I use a SQLite database in my app. It uses the code below to check if there is some data in it:</p> <pre><code>if(tableExists(dbStoring.getReadableDatabase(), "storing") == false) { Log.i("infotable", "no data in table"); } </code></pre> <p>In the LogCat of Eclipse i get sooooo many rules. Everything is working fine and i think it's not really an error, but it just annoys me. </p> <p>The LogCat starts with this:</p> <pre><code>12-19 10:56:37.038: I/Adreno200-EGLSUB(13336): &lt;ConfigWindowMatch:2078&gt;: Format RGBA_8888. 12-19 10:56:37.359: D/OpenGLRenderer(13336): Flushing caches (mode 0) 12-19 10:56:37.359: D/memalloc(13336): /dev/pmem: Unmapping buffer base:0x5235a000 size:9093120 offset:7557120 12-19 10:56:37.359: D/memalloc(13336): /dev/pmem: Unmapping buffer base:0x5326d000 size:4608000 offset:3072000 12-19 10:56:37.459: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.609: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.709: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.819: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.879: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.919: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.949: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:37.999: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:38.109: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:38.420: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:38.570: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:38.810: D/dalvikvm(13336): GC_CONCURRENT freed 714K, 11% free 7074K/7907K, paused 2ms+3ms 12-19 10:56:38.820: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=41535], tmpsocket.getSoLinger()=-1 12-19 10:56:38.820: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=40834], tmpsocket.getSoLinger()=-1 12-19 10:56:38.820: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=53381], tmpsocket.getSoLinger()=-1 12-19 10:56:38.830: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=51410], tmpsocket.getSoLinger()=-1 12-19 10:56:38.830: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=33980], tmpsocket.getSoLinger()=-1 12-19 10:56:38.830: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=55242], tmpsocket.getSoLinger()=-1 12-19 10:56:38.840: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=42039], tmpsocket.getSoLinger()=-1 12-19 10:56:38.850: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=60272], tmpsocket.getSoLinger()=-1 12-19 10:56:38.850: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=42813], tmpsocket.getSoLinger()=-1 12-19 10:56:38.860: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=33060], tmpsocket.getSoLinger()=-1 12-19 10:56:38.890: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:39.010: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:39.180: I/global(13336): In close() at SocketHttpClientConnection 12-19 10:56:39.280: D/dalvikvm(13336): GC_CONCURRENT freed 1959K, 23% free 6965K/8995K, paused 2ms+3ms 12-19 10:56:39.280: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=37229], tmpsocket.getSoLinger()=-1 12-19 10:56:39.280: I/global(13336): call socket shutdown, tmpsocket=Socket[address=/192.168.10.201,port=80,localPort=34051], tmpsocket.getSoLinger()=-1 </code></pre> <p>Then i get 700 rules with a constant repeat of there 3 rules (about 11 seconds non-stop writing), with exact the same information:</p> <pre><code>12-19 10:56:39.541: D/SqliteDatabaseCpp(13336): DB info: open db, path = /data/data/com.emmtec/databases , key = CecerejwDYtYF, flag = 6, file size = 18432 12-19 10:56:39.551: D/SqliteDatabaseCpp(13336): DB info: path = /data/data/com.emmtec/databases , key = CecerejwDYtYF, handle: 0x25ff138, type: w, r/w: (0,1), mode: truncate, disk free size: 827 M 12-19 10:56:40.682: D/SqliteDatabaseCpp(13336): DB info: close db, path = /data/data/com.emmtec/databases , key = CecerejwDYtYF, handle = 0x25ff138, type = w, r/w = (0, 0) </code></pre> <p>And it ends with:</p> <pre><code>12-19 10:58:42.821: D/OpenGLRenderer(13336): Flushing caches (mode 1) 12-19 10:58:43.151: D/OpenGLRenderer(13336): Flushing caches (mode 0) 12-19 10:58:43.241: D/memalloc(13336): /dev/pmem: Unmapping buffer base:0x53e33000 size:6144000 offset:4608000 12-19 10:58:43.251: D/memalloc(13336): /dev/pmem: Unmapping buffer base:0x5440f000 size:10629120 offset:9093120 12-19 10:58:43.251: D/memalloc(13336): /dev/pmem: Unmapping buffer base:0x524fa000 size:4608000 offset:3072000 </code></pre> <p>Method tableExists:</p> <pre><code>boolean tableExists(SQLiteDatabase db, String tableName) { if (tableName == null || db == null || !db.isOpen()) { return false; } Cursor cur = db.rawQuery("SELECT COUNT(*) FROM sqlite_master WHERE type = ? AND name = ?", new String[] {"table", tableName}); if (cur != null){ cur.moveToFirst(); try{ storing = dbStoring.getStoringFromDB(); String Naam = storing.getKlantNaam(); if(Naam.equals("")) { return false; } } catch(Exception e) { return false; } if (cur.getInt(0) == 0) { //getInt(0) == 0 means 0 rules return false; } } else { return true; } return true; } </code></pre> <p>this is the method getStoringFromDB:</p> <pre><code>public Storing getStoringFromDB(){ String query = "SELECT * FROM " + TABLE_STORING; SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.rawQuery(query, null); Storing storing = null; if (cursor.moveToFirst()) { storing = new Storing(); storing.setVolgnummer(cursor.getString(0)); storing.setKlantNaam(cursor.getString(1)); storing.setLocatie(cursor.getString(2)); storing.setSlaOvereenkomst(cursor.getString(3)); storing.setContactpersoon(cursor.getString(4)); storing.setHandtekeningString(cursor.getString(5)); storing.setHandtekeningAchternaam(cursor.getString(6)); storing.setHandtekeningVoornaam(cursor.getString(7)); storing.setOpdrachtnummer(cursor.getString(8)); storing.setTdMonteur(cursor.getString(9)); storing.setStartdatum(cursor.getString(10)); storing.setStarttijd(cursor.getString(11)); storing.setEinddatum(cursor.getString(12)); storing.setOmschrijvingStoring(cursor.getString(13)); storing.setOmschrijvingWerkzaamheden(cursor.getString(14)); storing.setProjectnummer(cursor.getString(15)); storing.setBehandelaar(cursor.getString(16)); storing.setFabriek(cursor.getString(17)); storing.setMachine(cursor.getString(18)); storing.setAantalUren(cursor.getString(19)); storing.setAantalBijzUren(cursor.getString(20)); storing.setAantalNachtUren(cursor.getString(21)); storing.setSpoedeisendeDienst(cursor.getString(22)); storing.setBedragOverigeKosten(cursor.getString(23)); storing.setToelichtingOverigeKosten(cursor.getString(24)); storing.setReiskosten(cursor.getString(25)); storing.setReistijd(cursor.getString(26)); storing.setStarttarief(cursor.getString(27)); } db.close(); return storing; } </code></pre> <p>Is there anyone who knows where i should search the solution so that i dont get this data in the LogCat?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload