Issue Details (XML | Word | Printable)

Key: OPENJPA-296
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Patrick Linskey
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

UUID algorithm generating non-unique values sometimes

Created: 25/Jul/07 05:59 PM   Updated: 25/Jul/07 06:01 PM
Return to search
Component/s: sql
Affects Version/s: 0.9.0, 0.9.6, 0.9.7
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

Resolution Date: 25/Jul/07 06:01 PM


 Description  « Hide
From the dev list:


@Entity
public class Foo {

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO, generator="uuid-string")
 private String id;

}

CREATE TABLE Foo (
 id VARCHAR(16) NOT NULL
}

If I do one em.persist() it works just fine. However, if I do a a whole
list of them, I get exceptions (duplicate). If I enable logging I can
see they are all using the same id during INSERT. I stepped a bit
through the code and noticed that uuid-string doesn't get generated
while em.persist(), but much later while committing/flushing. I then
looked a bit (just a bit) at the UUID generator code and noticed that
the bytes are not changing much (maybe only the first two), but again,
that was while debugging, so I'm assuming I have a supa-fast machine.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Patrick Linskey made changes - 25/Jul/07 06:01 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]