-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Incorrect sql statement reported on @Length validator
PostPosted: Tue Jul 07, 2009 2:43 pm 
Newbie

Joined: Mon Mar 30, 2009 5:15 pm
Posts: 6
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


Top
 Profile  
 
 Post subject: Re: Incorrect sql statement reported on @Length validator
PostPosted: Tue Jul 07, 2009 6:37 pm 
Newbie

Joined: Mon Mar 30, 2009 5:15 pm
Posts: 6
False alarm on the second suspected wrong-sql-reported: The values were not case sensitively unique in the source and the target has a case insensitive index on that column. So one down, one to go.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.