jamescheney / database-wiki

Automatically exported from code.google.com/p/database-wiki
GNU General Public License v3.0
2 stars 0 forks source link

Schema-versioning data import is broken. #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Data import is currently broken using the schema archiving  For example, using 
attached trivial file foo.xml, I get:

$ sh database-import.sh FOO FOO foo.xml jcheney
[TIME] [Duplicate version name]: Version 8 May 2011 17:06:49 already exists
    at org.dbwiki.data.time.version.VectorVersionIndex.add(VectorVersionIndex.java:70)
    at org.dbwiki.driver.rdbms.DatabaseImportHandler.endImport(DatabaseImportHandler.java:64)
    at org.dbwiki.data.io.XMLDocumentImportReader.start(XMLDocumentImportReader.java:106)
    at org.dbwiki.web.server.WikiServer.registerDatabase(WikiServer.java:717)
    at org.dbwiki.main.DatabaseImport.main(DatabaseImport.java:91)

This also happens if I try to add data through the web interface.

Original issue reported on code.google.com by james.ch...@gmail.com on 8 May 2011 at 4:09

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by james.ch...@gmail.com on 1 Jun 2011 at 12:12

GoogleCodeExporter commented 9 years ago
The issue was caused by a clash between the 'name' of the version associated 
with the schema and the version associated with the data. The name is currently 
just a string representation of the date. Both were being generated in the same 
second, so being assigned the same name. (Of course, when I ran it through the 
debugger the bug disappeared because the versions were being generated in 
different seconds.) The current workaround attempts to ensure that the names 
are unique, but is a little bit fragile.

The real solution is to fix the design of versions.

Original comment by Sam.Lind...@ed.ac.uk on 2 Jun 2011 at 4:18