title: Android: SQLite database insertion successful yet with repetitive error messages
body: <p>The code shown should take data from a text file and insert it into a database (currently only 1 table is being filled, the other insertion loops have been commented out). </p>
  
  <p>The population of the pieceTable takes place inside the if statement inside the ManipulateDatabase constructor. At present, the database is filled (known because a select statement can retrieve data from it) yet the LogCat shows repeated errors in inserting various Strings to the table.</p>
  
  <p>I have added LogCat output below but have had to use PasteBin to attach code due to character limitations in the post: <a href="http://pastebin.com/aR6kA3u8" rel="nofollow">http://pastebin.com/aR6kA3u8</a></p>
  
  <p>Any suggestions of the source of the error would be greatly appreciated.</p>
  
  <pre><code>01-03 20:03:46.126: D/gralloc_goldfish(535): Emulator without GPU emulation detected.
  01-03 20:04:20.085: E/SQLiteDatabase(535): Error inserting isPlay=1 piece=A View from the Bridge
  01-03 20:04:20.085: E/SQLiteDatabase(535): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.native_executeInsert(Native Method)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:113)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1718)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1591)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.ManipulateDatabase.&lt;init&gt;(ManipulateDatabase.java:576)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.Novel.onCreate(Novel.java:22)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.Activity.performCreate(Activity.java:4465)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.os.Handler.dispatchMessage(Handler.java:99)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.os.Looper.loop(Looper.java:137)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at android.app.ActivityThread.main(ActivityThread.java:4424)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invokeNative(Native Method)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invoke(Method.java:511)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  01-03 20:04:20.085: E/SQLiteDatabase(535):  at dalvik.system.NativeStart.main(Native Method)
  01-03 20:04:20.085: I/System.out(535): A View from the Bridge,1 THIS INSERTION SHOULD HAVE JUST FINISHED
  01-03 20:04:20.115: E/SQLiteDatabase(535): Error inserting isPlay=1 piece=An Inspector Calls
  01-03 20:04:20.115: E/SQLiteDatabase(535): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.native_executeInsert(Native Method)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:113)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1718)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1591)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.ManipulateDatabase.&lt;init&gt;(ManipulateDatabase.java:576)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.Novel.onCreate(Novel.java:22)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.Activity.performCreate(Activity.java:4465)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.os.Handler.dispatchMessage(Handler.java:99)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.os.Looper.loop(Looper.java:137)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at android.app.ActivityThread.main(ActivityThread.java:4424)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invokeNative(Native Method)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invoke(Method.java:511)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  01-03 20:04:20.115: E/SQLiteDatabase(535):  at dalvik.system.NativeStart.main(Native Method)
  01-03 20:04:20.115: I/System.out(535): An Inspector Calls,1 THIS INSERTION SHOULD HAVE JUST FINISHED
  01-03 20:04:20.145: E/SQLiteDatabase(535): Error inserting isPlay=0 piece=Of Mice and Men
  01-03 20:04:20.145: E/SQLiteDatabase(535): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.native_executeInsert(Native Method)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:113)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1718)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1591)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.ManipulateDatabase.&lt;init&gt;(ManipulateDatabase.java:576)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.Novel.onCreate(Novel.java:22)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.Activity.performCreate(Activity.java:4465)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.os.Handler.dispatchMessage(Handler.java:99)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.os.Looper.loop(Looper.java:137)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at android.app.ActivityThread.main(ActivityThread.java:4424)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invokeNative(Native Method)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invoke(Method.java:511)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  01-03 20:04:20.145: E/SQLiteDatabase(535):  at dalvik.system.NativeStart.main(Native Method)
  01-03 20:04:20.145: I/System.out(535): Of Mice and Men,0 THIS INSERTION SHOULD HAVE JUST FINISHED
  01-03 20:04:20.186: E/SQLiteDatabase(535): Error inserting isPlay=0 piece=To Kill a Mockingbird
  01-03 20:04:20.186: E/SQLiteDatabase(535): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.native_executeInsert(Native Method)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:113)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1718)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1591)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.ManipulateDatabase.&lt;init&gt;(ManipulateDatabase.java:576)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at com.lawson.englishlitrevision.Novel.onCreate(Novel.java:22)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.Activity.performCreate(Activity.java:4465)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.os.Handler.dispatchMessage(Handler.java:99)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.os.Looper.loop(Looper.java:137)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at android.app.ActivityThread.main(ActivityThread.java:4424)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invokeNative(Native Method)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at java.lang.reflect.Method.invoke(Method.java:511)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  01-03 20:04:20.186: E/SQLiteDatabase(535):  at dalvik.system.NativeStart.main(Native Method)
  01-03 20:04:20.186: I/System.out(535): To Kill a Mockingbird,0 THIS INSERTION SHOULD HAVE JUST FINISHED
  01-03 20:04:20.206: I/System.out(535): Of Mice and Men HAS JUST BEEN ADDED TO PIECE ARRAYLIST FETCHED FROM DB
  01-03 20:04:20.206: I/System.out(535): To Kill a Mockingbird HAS JUST BEEN ADDED TO PIECE ARRAYLIST FETCHED FROM DB
  01-03 20:04:20.246: D/dalvikvm(535): GC_CONCURRENT freed 228K, 4% free 9288K/9607K, paused 5ms+3ms
  </code></pre>