I've been using H2 for years now and really appreciate it, but one thing I 
can't figure out is how to know when, e.g., an INSERT causes a duplicate 
violation.

In other databases (postgresql I'm pretty sure, but not positive) an 
exception of the type SQLIntegrityConstraintViolationException is thrown.  
But this doesn't seem to be the case in H2.

I think we can check the error code for 23505, but this seems fragile and 
platform dependent.

Is there a reason why H2 doesn't 
use SQLIntegrityConstraintViolationException?  Maybe there is some other 
method I'm missing?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to