I'm transfering records from one db to another (classic ELT). Reading with straight jdbc but loading JPA entities. The entity (User) uses the @Length(min=2, max=128) on last_name. There are records which fail the test, but when the validator kicks in the reported problematic sql shows a perfect record. In the debugger I can see that the value in the InvalidStateException is indeed a single letter (fake names usually).
I can get past this, which I will have to do, by checking the length of last name on the source record and padding it (or ignoring the record altogether), but I'm curious to know if anyone else has experienced a similar problem. Is the sqlexception being handed the wrong element in the batch when the validator fires?
I may be seeing a similar wrong-sql-reported problem from another bad-data feature, but this one isn't generated by an annotation validator. Here I'm violating a uniqueness constraint but the value in reported sql is unique in both the source and the non-empty target dbs
Hibernate-3.2, java-1.6, postgres-8.3. Using batch size of 1000. Statement.setMaxRows(1000) and hibernate.jdbc.batch_size=1000
|