vendredi 4 septembre 2015

Cannot open file at line 27805

I have a huge problem I cannot get my head around, basically when accessing my android database after approximately 130 reads from the database it throws this into the logcat and the activity ends. The database is reading perfectly up until this point and cannot see a reason why it fails at this point every time. 09-04 16:45:31.754: E/SQLiteLog(4213): (14) cannot open file at line 27805 of [9491ba7d73] 09-04 16:45:31.754: E/SQLiteLog(4213): (14) os_unix.c:27805: (24) open(/data/data/com.boltgames.dev.cricketone/databases) - 09-04 16:45:31.758: E/SQLiteLog(4213): (14) cannot open file at line 30046 of [9491ba7d73] 09-04 16:45:31.758: E/SQLiteLog(4213): (14) os_unix.c:30046: (24) open(/data/data/com.boltgames.dev.cricketone/databases/Student.db-journal) - 09-04 16:45:31.758: E/SQLiteLog(4213): (14) cannot open file at line 30046 of [9491ba7d73] 09-04 16:45:31.758: E/SQLiteLog(4213): (14) os_unix.c:30046: (24) open(/data/data/com.boltgames.dev.cricketone/databases/Student.db-journal) - 09-04 16:45:31.758: E/SQLiteLog(4213): (14) statement aborts at 37: [SELECT DISTINCT _id, NAME, SURNAME, AGE, STAMINA, FITNESS, BOWLINGSKILL, BATTINGSKILL, OVERS, MAIDENS, BWLRUNS, WICKETS, ECONOMY, STRIKERATE, INNS, NOTOUT, BATRUNS, FIFTY, HUNDRED, FOU 09-04 16:45:31.759: E/SQLiteQuery(4213): exception: unable to open database file (code 14); query: SELECT DISTINCT _id, NAME, SURNAME, AGE, STAMINA, FITNESS, BOWLINGSKILL, BATTINGSKILL, OVERS, MAIDENS, BWLRUNS, WICKETS, ECONOMY, STRIKERATE, INNS, NOTOUT, BATRUNS, FIFTY, HUNDRED, FOURS, SIXES, DUCKS, CURBALLS, CURRUNS, CURFOURS, CURSIXES FROM Langley 09-04 16:45:31.759: D/AndroidRuntime(4213): Shutting down VM 09-04 16:45:31.760: E/AndroidRuntime(4213): FATAL EXCEPTION: main 09-04 16:45:31.760: E/AndroidRuntime(4213): Process: com.boltgames.dev.cricketone, PID: 4213 09-04 16:45:31.760: E/AndroidRuntime(4213): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:845) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:144) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:197) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:237) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.boltgames.dev.cricketlife.DatabaseHelper.getAllRows(DatabaseHelper.java:124) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.boltgames.dev.cricketlife.Play.SetData(Play.java:149) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.boltgames.dev.cricketlife.Play.SetPlayers(Play.java:134) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.boltgames.dev.cricketlife.Play.PlayOneRun(Play.java:277) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.boltgames.dev.cricketlife.Play$1.onClick(Play.java:249) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.view.View.performClick(View.java:4780) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.view.View$PerformClick.run(View.java:19866) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.os.Handler.handleCallback(Handler.java:739) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.os.Handler.dispatchMessage(Handler.java:95) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.os.Looper.loop(Looper.java:135) 09-04 16:45:31.760: E/AndroidRuntime(4213): at android.app.ActivityThread.main(ActivityThread.java:5254) 09-04 16:45:31.760: E/AndroidRuntime(4213): at java.lang.reflect.Method.invoke(Native Method) 09-04 16:45:31.760: E/AndroidRuntime(4213): at java.lang.reflect.Method.invoke(Method.java:372) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 09-04 16:45:31.760: E/AndroidRuntime(4213): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Here is my access code to the database

cursor = mydb.getAllRows(gamemanager.hometeam);
    cursor.moveToFirst();
    startManagingCursor(cursor);
    String[] fromfieldnames = new String[]{DatabaseHelper.COL_2, DatabaseHelper.COL_3,
            DatabaseHelper.COL_23, DatabaseHelper.COL_24};
    int[] toviewids = new int[]{R.id.scorecplayer, R.id.scorecsur, R.id.scorecballs, R.id.scorecruns};
    mycursoradaptor = new SimpleCursorAdapter(this, R.layout.scorecardbat,
            cursor, fromfieldnames, toviewids);
    batting.setAdapter(mycursoradaptor);
    totruns.setText(Long.toString(totalruns));
    ballComplete = true;
    oneballnorun.setVisibility(View.VISIBLE);

Please help :(

M.

Aucun commentaire:

Enregistrer un commentaire