Hi,

> @GeneratedValue(strategy = GenerationType.TABLE)

This seems to be a relatively common problem (at least I found others
get similar problems by doing a Google search).

> But why a different message occur for other ('normal') cases?
> Is it different because the primary key (MYTABLE.ID) instead of the
> additional unique constraint (on MYTABLE.NAME) is violated?

The problem is (warning: technical details ahead), if you have a
single column primary key, and the data type is INT, BIGINT, or
similar, then there is no actual index created. Instead, the "main"
lookup method of the table is used (which is also a b-tree structure,
like regular indexes, but it uses different class and storage format:
class PageDataIndex instead of PageBtreeIndex). That's where the
"_DATA" comes from in the error message. There is always a
PageDataIndex even if there is no primary key, so the database is
re-using that if possible. but unfortunately it's also re-using the
name of that object in the error message, which is wrong. This is what
I will fix. Other databases call this a "clustered index" by the way:
http://en.wikipedia.org/wiki/Index_%28database%29#Clustered

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-datab...@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to