Database migration error

Post Reply
swhyatt
Posts: 3
Joined: 24 Jun 2014 03:44

Database migration error

Post by swhyatt » 24 Jun 2014 03:54

Hi, I am getting an 'unexpected error occurred' message when trying to export my 1.3 database to the new 1.4 format. While the .zolca file is created, it is missing much of the data and I am therefore unable to use my model in version 1.4. I have included an extract from the log file below and would appreciate any advice you may be able to provide.

Log file extract====
Log session start time Tue Jun 24 11:03:26 CST 2014

Time Thread Level Category Message
0 main INFO org.openlca Log-level=INFO
1407 main INFO org.openlca.core.application.navigation.NavigationRoot Initialize navigation
1477 main INFO org.openlca.core.application.navigation.NavigationRoot Initialize navigation
5221 main INFO org.openlca.core.application.navigation.NavigationRoot Initialize navigation
25864 ModalContext INFO org.openlca.xdb.upgrade.DerbyDatabase initialize database folder /var/folders/5m/pmcxgb3j72dd_xcwcm89p09h0000gn/T/360d7a38-634c-4f7f-8c1a-54cd962e1311, create=true
27487 ModalContext ERROR org.openlca.xdb.upgrade.Mapper failed to insert batch: INSERT INTO tbl_impact_factors(id, f_impact_category, f_flow, f_flow_property_factor, f_unit, value, distribution_type, parameter1_value, parameter1_formula, parameter2_value, parameter2_formula, parameter3_value, parameter3_formula) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
java.sql.SQLDataException: Invalid character string format for type INTEGER.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.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.EmbedResultSet.noStateChangeException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setString(Unknown Source)
at com.jolbox.bonecp.PreparedStatementHandle.setString(PreparedStatementHandle.java:1013)
at org.openlca.xdb.upgrade.ImpactFactor$Handler.map(ImpactFactor.java:80)
at org.openlca.xdb.upgrade.ImpactFactor$Handler.map(ImpactFactor.java:47)
at org.openlca.xdb.upgrade.UpdateHandler.addBatch(UpdateHandler.java:27)
at org.openlca.xdb.upgrade.NativeSql.insertRows(NativeSql.java:72)
at org.openlca.xdb.upgrade.NativeSql.batchInsert(NativeSql.java:62)
at org.openlca.xdb.upgrade.Mapper.flushMappings(Mapper.java:85)
at org.openlca.xdb.upgrade.Mapper.mapAll(Mapper.java:56)
at org.openlca.xdb.upgrade.ImpactFactor.map(ImpactFactor.java:44)
at org.openlca.xdb.upgrade.Update.run(Update.java:73)
at org.openlca.xdb.upgrade.FileExport.run(FileExport.java:42)
at org.openlca.xolca.db.upgrade.ExportWizard$Export.run(ExportWizard.java:88)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.sql.SQLException: Invalid character string format for type INTEGER.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 18 more
Caused by: ERROR 22018: Invalid character string format for type INTEGER.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.types.DataType.invalidFormat(Unknown Source)
at org.apache.derby.iapi.types.SQLInteger.setValue(Unknown Source)
... 14 more
27566 ModalContext INFO org.openlca.xdb.upgrade.DerbyDatabase exception: 50000
27567 ModalContext INFO org.openlca.xdb.upgrade.DerbyDatabase database closed
Attachments
log.html.zip
(1.74 KiB) Downloaded 294 times

aciroth
Posts: 750
Joined: 09 May 2010 23:28

Re: Database migration error

Post by aciroth » 25 Jun 2014 16:12

Hi Simon,
the migration plugin assumes the 1.3.4 database version. Could it be that you are using an older version? If yes, please first migrate from 1.3.x to 1.3.4 and apply the plugin then.
Hth,
Andreas

swhyatt
Posts: 3
Joined: 24 Jun 2014 03:44

Re: Database migration error

Post by swhyatt » 26 Jun 2014 01:31

Andreas,

I can confirm that the exception occurred when attempting to migrate a 1.3.4 database to version 4.

Regards,
Simon

aciroth
Posts: 750
Joined: 09 May 2010 23:28

Re: Database migration error

Post by aciroth » 26 Jun 2014 17:24

Hi Simon,
ah indeed, there was an error in the update plugin with uncertainties in processes - we fixed it and created a new version of the migration plugin which you can update via the plugin manager (version 1.3.0), or use this link for manual installation: https://nexus.openlca.org/updatesite/pl ... _1.3.0.jar
Cheers
Andreas

swhyatt
Posts: 3
Joined: 24 Jun 2014 03:44

Re: Database migration error

Post by swhyatt » 27 Jun 2014 01:14

Andreas, all sorted now. Many thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests