Can't import Amstrad DB (Gamebase CPC v27)
Brought to you by:
fgerbig
Caused by: ERROR XIE0R: Import error on line 2 of file .jgamebase/GB_Amstrad/Export/Extras.csv.sle: INSERT on table 'EXTRAS' caused a violation of foreign key constraint 'FK9C6YWNU4O5RJN5R016HHNRD9J' for key (2). The statement has been rolled back.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 26 more
Caused by: org.apache.derby.shared.common.error.DerbySQLIntegrityConstraintViolationException: INSERT on table 'EXTRAS' caused a violation of foreign key constraint 'FK9C6YWNU4O5RJN5R016HHNRD9J' for key (2). The statement has been rolled back.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
at org.apache.derby.impl.load.Import.performImport(Unknown Source)
at org.apache.derby.impl.load.Import.importTable(Unknown Source)
at org.apache.derby.catalog.SystemProcedures.SYSCS_IMPORT_TABLE(Unknown Source)
at org.apache.derby.exe.ac560740aax0168x6c0ax84e5x00001944937f34.g0(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
... 19 more
Caused by: ERROR 23503: INSERT on table 'EXTRAS' caused a violation of foreign key constraint 'FK9C6YWNU4O5RJN5R016HHNRD9J' for key (2). The statement has been rolled back.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.bulkValidateForeignKeysCore(Unknown Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.bulkValidateForeignKeys(Unknown Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
... 35 more
Anonymous
Same FK key problem with Atari 800 DB
Hi ablaszczyk,
Could you please send me the Access databases (*.mdb) in question?
Best regards,
Frank
Am 21.01.19 um 18:49 schrieb F. Gerbig:
Related
Bugs:
#29Here You go.
Last edit: ablaszczyk 2019-01-22
Hi ablaszczyk,
I'll have to investigate.
Best regards,
Frank
Hi ablaszczyk,
The problem in the Amstrad CPC database is a minor inconsistency (one Extra specifies a non existing game id). Import should work in the next release.
Did not analyze the problem in the Atari 800 db yet.
Kind regards,
Frank
Hi ablaszczyk,
"Amstrad CPC" and "Atari 800 v12" Access databases can be imported with jGB release V0.68-4.
Kind regards,
Frank
Amstrad:
Atari:
Got similar problems with Amiga DB.
And i'm guessing import is running (a lot slower), but I'm missing some indicator to assure me that app is still working.
Eg. my last message was
~~~
java.sql.SQLException: Import error on line 1 of file .jgamebase/GB_Amiga/Export/Extras.csv.sle: INSERT on table 'EXTRAS' caused a violation of foreign key constraint 'FK9C6YWNU4O5RJN5R016HHNRD9J' for key (3894). The statement has been rolled back
~~~
An i don't have a clue, should i wait another 30 min? Cpu is not high, no disk usage.
Any chances for some indicators? like increasing number in progress bar?
EDIT:
~~~
Table 'EXTRAS': skipping line #6070 of 9883 lines
~~~
OH it is still running !!! Nice :) Thank You!
Last edit: ablaszczyk 2019-01-25
Hi ablaszczyk,
I just checked, with V0.68-4 I can import the "Amstrad CPC" database.
The exception about the violation of foreign key constraint is ok (that is the inconsistency in the database: something like "this Extra belongs to game number 12", when there is no game number 12). So this line is skipped, but the rest of the table is imported (see line "Table 'Extras': 10816 rows imported.").
The import needed ca. 5 minutes, after the import the database selection window is shown (including the new db).
Kind regards,
Frank
===
The output of my test import:
frank@twix:~$ jgamebase
Java version: "1.8.0_191": ok
jGameBase V0.68-4 (2019-01-25)
GNU General Public License version 3.
Copyright © 2006-2019 by Frank Gerbig.
Thanks to James Burrows.
Program directory = "/usr/share/games/jgamebase"
Database directory = "/home/frank/.jgamebase"
Lock file = "/var/lock/jgamebase"
Writing log to "/home/frank/.jgamebase/jgamebase.log"
Loaded plugin: extractor 'RAR'.
Loaded plugin: extractor '7Z'.
Loaded plugin: extractor 'ZIP'.
Looking for Access databases to import in '/home/frank/.jgamebase/Amstrad CPC'
Found unimported access database '/home/frank/.jgamebase/Amstrad CPC/Amstrad CPC.mdb'.
Creating database 'Amstrad CPC'...
Starting import of database: Amstrad CPC
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Config.csv' into table 'CONFIG'.
Table 'Config': 1 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Crackers.csv' into table 'CRACKERS'.
Table 'Crackers': 9 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Difficulty.csv' into table 'DIFFICULTY'.
Table 'Difficulty': 8 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/PGenres.csv' into table 'PGENRES'.
Table 'PGenres': 14 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Genres.csv' into table 'GENRES'.
Table 'Genres': 209 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Languages.csv' into table 'LANGUAGES'.
Table 'Languages': 32 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Musicians.csv' into table 'MUSICIANS'.
Table 'Musicians': 422 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Programmers.csv' into table 'PROGRAMMERS'.
Table 'Programmers': 1260 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Publishers.csv' into table 'PUBLISHERS'.
Table 'Publishers': 404 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Years.csv' into table 'YEARS'.
Table 'Years': 140 rows imported.
Table 'Music': 0 rows imported.
Table 'ViewData': 0 rows imported.
Table 'ViewFilters': 0 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Artists.csv' into table 'ARTISTS'.
Table 'Artists': 652 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Developers.csv' into table 'DEVELOPERS'.
Table 'Developers': 598 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Licenses.csv' into table 'LICENSES'.
Table 'Licenses': 17 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Rarities.csv' into table 'RARITIES'.
Table 'Rarities': 7 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Games.csv' into table 'GAMES'.
Table 'Games': 2700 rows imported.
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Extras.csv' into table 'EXTRAS'.
Switching to alternate import method because of the following exception: org.hibernate.exception.GenericJDBCException: error executing work
Importing data from csv file '/home/frank/.jgamebase/Amstrad CPC/Export/Extras.csv' into table 'EXTRAS' line by line.
Table 'EXTRAS': skipping line #1 of 10817 lines:
[1, 2, 0, 0, Instructions (French), Manuals\saboteur II - Avenging Angel.pdf, true, , ]
because of the following exception:
java.sql.SQLException: Import error on line 2 of file /home/frank/.jgamebase/Amstrad CPC/Export/Extras.csv.sle: INSERT on table 'EXTRAS' caused a violation of foreign key constraint 'FK9C6YWNU4O5RJN5R016HHNRD9J' for key (2). The statement has been rolled back.
Table 'Extras': 10816 rows imported.
Import of database successfully finished.
Starting reorganization of database.
Reorganizing table 'CONFIG'.
Reorganizing table 'CRACKERS'.
Reorganizing table 'DIFFICULTY'.
Reorganizing table 'PGENRES'.
Reorganizing table 'GENRES'.
Reorganizing table 'LANGUAGES'.
Reorganizing table 'MUSICIANS'.
Reorganizing table 'PROGRAMMERS'.
Reorganizing table 'PUBLISHERS'.
Reorganizing table 'YEARS'.
Reorganizing table 'MUSIC'.
Reorganizing table 'VIEWDATA'.
Reorganizing table 'VIEWFILTERS'.
Reorganizing table 'ARTISTS'.
Reorganizing table 'DEVELOPERS'.
Reorganizing table 'LICENSES'.
Reorganizing table 'RARITIES'.
Reorganizing table 'GAMES'.
Reorganizing table 'EXTRAS'.
Reorganization of database successfully finished.
Looking for Access databases to import in '/home/frank/.jgamebase/Overlays'
Looking for Access databases to import in '/home/frank/.jgamebase/ToDoLater'
Found database 'Amiga'.
Found database 'Amstrad CPC'.
Found database 'Apple2Mania'.
Found database 'AtariST'.
Found database 'C64'.
Found database 'C64Demos'.
Found database 'C64lite'.
Found database 'ColecoVision'.
Found database 'IntelliVision'.
Found database 'MegaDrive'.
Found database 'N64'.
Found database 'NES-US'.
Found database 'SNES-US'.
Found database 'SpeccyMania'.
Found database 'SpeccyMania4'.
Found database 'VIC20'.
Found database 'VIC20_V3'.
Found database 'Vectrex'.
No database selected.
Exiting...
jGameBase finished.
Yes, thank You. Working perfectly fine. Import taking a little bit longer than usual, but works. Had not problems importing Amiga/Amstrad/Atari DBs (they had FK errors)
Thank You!