UUID and Java :)

Well, UUID stands for something UNIQUE. How that happend that it simply doesn’t work?

I had to use a program that generates some random data in the database. The primary key is UUID, so the program generates a lot of UUIDs. It uses standard Java’s way of generating UUIDs, the function: UUID.randomUUID().

That program failed twice, it was a database error, that the UUID exists in the database. I’ve created only a litttle bit over 50k of database rows. There were two collisions. What a crap.

I told that the author of the software, he said that he had the same situation last week.

Another argument for not using UUIDs as Primary Keys.