duplicate key sql error syncing db

Bug #832057 reported by marcobra (Marco Braida)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Syncany
New
Undecided
Unassigned

Bug Description

Running syncany on ubuntu 10.04.3 32bits local setup

i get this error ( removing the .$HOME/.syncany/db do not solve )

11-08-23 16:43:53 | ubuntu-desktop | org.eclipse.persistence.session.file:/home/ubuntu/syncany/syncany/dist/lib/syncany.jar_Syncany_url=jdbc:derby:/home/ubuntu/.syncany/db/syncany;create=true | InitProfiles | WARNING :
Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL110823164346140' defined on 'CLONEFILE_CLONECHUNK'.
Error Code: 20000
Call: INSERT INTO CLONEFILE_CLONECHUNK (chunks_checksum, root_id, file_version, file_id, profile_id, chunks_ORDER) VALUES (?, ?, ?, ?, ?, ?)
 bind => [6 parameters bound]
Query: DataModifyQuery(name="chunks" sql="INSERT INTO CLONEFILE_CLONECHUNK (chunks_checksum, root_id, file_version, file_id, profile_id, chunks_ORDER) VALUES (?, ?, ?, ?, ?, ?)")
 at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
 at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:798)

Thank you

Revision history for this message
Philipp C. Heckel (binwiederhier) wrote :

I've had this problem multiple times. It's an issue with JPA's List handling: JPA does not allow duplicates in a List object, which is problematic if one files contains a single chunk multiple times.

However, my current plan (and the code on my machine) gets rid of JPA entirely, so this won't be an issue anymore. I am switching to an in-memory scheme, and store the DB using my own file format.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.