Hi...!
This is a general question altough I'm using Hibernate Annotations, JPA and PostgreSQL. I've searched through the forums and documentation and found some mentions but no solutions...
I've got an application running a database. There is a sequence named "hibernate-sequence". Nothing special until now.
I do a initial load of some data, using DBUnit. That works well, but there is a problem: the sequence doesn't get incremented so when I do the first insert using an Hibernate DAO, there is a ConstraintViolationException. The sequence gives me an ID that already exists in the table.
That is a real problem itself, but leads me to further preoupations. ¿What if there are several applications using the same database? Let's say for example, one with Hibernate, another with PHP and one more with classic JDBC.
¿Will work the ID generation? For now it seems not. ¿What can be done?
I guess there are some people with the same questions, it would be fine to find a good answer :-)
Lots of thanks...!
satanicoPlan
|