,   CyberForum.ru

"Attempt to re-open an already-closed object" SQLite - Android


Android Android http://www.cyberforum.ru/android-dev/thread1416961.html
"alien shooter" . , .
Android , - ( ), ) http://www.cyberforum.ru/android-dev/thread1416904.html
" " Android
, " " ( , -). , ??? , ! Voice Recorder ...
Android - , ,
! , , ... ! ... ! ! ? ? - . ( ). - - , . ...
Android http://www.cyberforum.ru/android-dev/thread1416836.html
. . ?? ?? () ?? 1 29 . ...
Android Debugger, ? . , Android Studio . . , . 2 : 1) . AS "Connected to the target VM, address:...

Naomis
5 / 5 / 1
: 11.03.2015
: 196
: 1
09.04.2015, 20:07  []     "Attempt to re-open an already-closed object" SQLite
Armagedo, db.close(); !!

Prolog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
04-09 19:47:32.231  28374-28380/com.example.kirukato.coolstdreg D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
04-09 19:57:15.747  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕     
04-09 19:57:15.757  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ - 
04-09 19:57:15.767  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ Ĩ '' 
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ !
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕    --- if (edtMan.getSelectedItem() != null) ---
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if    -----
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if -----   checkMan = true;
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if -----   checkMan = true;-- 
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if-----    cur = db.GetCatalogValueByName(.........);
04-09 19:57:21.734  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕  edtMan.getSelectedItem().toString()------
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/DB__ACTIVITY﹕ ----  GetCatalogValueByName----
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/DB__ACTIVITY﹕ ---  . select _id from man where name = ' '
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/DB__ACTIVITY﹕ select _id from man where name = ' '
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/DB__ACTIVITY﹕ 1
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if-----    cur = db.GetCatalogValueByName(.........);-------
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if-----    _id ---- cManID = cur.getInt(...._id")-----
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕ ----if-----    _id ---- cManID = cur.getInt(...._id")-----
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/EVENT__ACTIVITY﹕   E  --- if (edtET.getSelectedItem() != null) ---
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/DB__ACTIVITY﹕ ----  GetCatalogValueByName----
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg V/DB__ACTIVITY﹕ ---  . select _id from event_type where FullName = '   '
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg E/SQLiteLog﹕ (1) no such column: FullName
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg D/AndroidRuntime﹕ Shutting down VM
04-09 19:57:21.744  30740-30740/com.example.kirukato.coolstdreg W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x4154d8b0)
04-09 19:57:21.754  30740-30740/com.example.kirukato.coolstdreg E/AndroidRuntime﹕ FATAL EXCEPTION: main
    android.database.sqlite.SQLiteException: no such column: FullName (code 1): , while compiling: select _id from event_type where FullName = '   '
            at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
            at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
            at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
            at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
            at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
            at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
            at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
            at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1322)
            at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1261)
            at com.example.kirukato.coolstdreg.DB.GetCatalogValueByName(DB.java:156)
            at com.example.kirukato.coolstdreg.EventActivity$1.onClick(EventActivity.java:109)
            at android.view.View.performClick(View.java:4421)
            at android.view.View$PerformClick.run(View.java:17903)
            at android.os.Handler.handleCallback(Handler.java:730)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:213)
            at android.app.ActivityThread.main(ActivityThread.java:5225)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
            at dalvik.system.NativeStart.main(Native Method)
, ...
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Log.v(TAG, "   --- if (edtMan.getSelectedItem() != null) ---" );
 
                if (edtMan.getSelectedItem() != null)
                {
                    Log.v(TAG, "----if    -----" );
                    Log.v(TAG, "----if -----   checkMan = true;" );
                    checkMan = true;
                    Log.v(TAG, "----if -----   checkMan = true;-- " );
 
 
                    Log.v(TAG, "----if-----    cur = db.GetCatalogValueByName(.........);\n" );
                    Log.v(TAG, " edtMan.getSelectedItem().toString()------" + edtMan.getSelectedItem().toString() );
                    cur = db.GetCatalogValueByName("man", "_id", "name", edtMan.getSelectedItem().toString());
                    Log.v(TAG, "----if-----    cur = db.GetCatalogValueByName(.........);-------" );
 
                    Log.v(TAG, "----if-----    _id ---- cManID = cur.getInt(...._id\")-----" );
                    cManID = cur.getInt(cur.getColumnIndex("_id"));
                    Log.v(TAG, "----if-----    _id ---- cManID = cur.getInt(...._id\")-----" );
                    //db.addRec("event", DB.EVENT_COLUMN_MAN, cManID );
                }
.
.
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
if (edtMan.getSelectedItem() != null)
                {
                    Log.v(TAG, "----if    -----" );
                    Log.v(TAG, "----if -----   checkMan = true;" );
                    checkMan = true;
                    Log.v(TAG, "----if -----   checkMan = true;-- " );
 
 
                    Log.v(TAG, "----if-----    cur = db.GetCatalogValueByName(.........);\n" );
                    Log.v(TAG, " edtMan.getSelectedItem().toString()------" + edtMan.getSelectedItem().toString() );
                    cur = db.GetCatalogValueByName("man", "_id", "name", edtMan.getSelectedItem().toString());
                    Log.v(TAG, "----if-----    cur = db.GetCatalogValueByName(.........);-------" );
 
                    Log.v(TAG, "----if-----    _id ---- cManID = cur.getInt(...._id\")-----" );
                    cManID = cur.getInt(cur.getColumnIndex("_id"));
                    Log.v(TAG, "----if-----    _id ---- cManID = cur.getInt(...._id\")-----" );
                    //db.addRec("event", DB.EVENT_COLUMN_MAN, cManID );
                }
 
                Log.v(TAG, "  E  --- if (edtET.getSelectedItem() != null) ---" );
                if (edtET.getSelectedItem() != null)
                {
                    checkET = true;
                    cur = db.GetCatalogValueByName("event_type", "_id", "FullName", edtET.getSelectedItem().toString());
                    cETID = cur.getInt(cur.getColumnIndex("_id"));
                    //db.addRec("event", DB.EVENT_COLUMN_EVENT_TYPE, cETID );
                }
 
                Log.v(TAG, "   --- if (edtMeet.getSelectedItem() != null) ---" );
                if (edtMeet.getSelectedItem() != null)
                {
                    checkMeet = true;
                    cur = db.GetCatalogValueByName("event_type", "_id", "FullName", edtMeet.getSelectedItem().toString());
                    cMeetID = cur.getInt(cur.getColumnIndex("_id"));
                    //db.addRec("event", DB.EVENT_COLUMN_MEETING, cMeetID );
                }
 
                Log.v(TAG, "   'TRUE'     'event' --- if(checkMan != false & checkET != false & checkMeet != false) ---" );
 
                //   true,      "event"
                if(checkMan != false & checkET != false & checkMeet != false){
 
                    Log.v(TAG, "   ---- db.addRec(\"event\", DB.EVENT_COLUMN_MAN, cManID ); ---" );
                    db.addRec("event", DB.EVENT_COLUMN_MAN, cManID );
                    Log.v(TAG, "" );
 
                    Log.v(TAG, "   ---- db.addRec(\"event\", DB.EVENT_COLUMN_EVENT_TYPE, cETID ); ---" );
                    db.addRec("event", DB.EVENT_COLUMN_EVENT_TYPE, cETID );
                    Log.v(TAG, "" );
 
                    Log.v(TAG, "    ---- ---" );
                    db.addRec("event", DB.EVENT_COLUMN_MEETING, cMeetID );
 
                    if (checkboxEvent.isChecked() == true) {
                        db.addRec("event", DB.EVENT_COLUMN_VALUE, 1 );
                        Log.v(TAG, "---1" );
 
                    }else {
                        db.addRec("event", DB.EVENT_COLUMN_VALUE, 0 );
                        Log.v(TAG, "---0" );
                    }
 
                }
1
Armagedo, , , .
 
: 17:48. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru