Hi all,
I have 2 applications working on the same oracle db schema: j2se (desktop application) and web application(deployed on tomcat 7).
and this my entity class :
Code:
public class Owner implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(name="OWNERS_OWNERID_GENERATOR", sequenceName="OWNERS_SEQ",allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="OWNERS_OWNERID_GENERATOR")
@Column(name="OWNER_ID", unique=true, nullable=false)
private long ownerId;
@Column(nullable=false, length=40)
private String description;
public Owner() {
}
setters and getteres
}
everything is ok in the desktop application, but when I package my entity with persistence.xml in a jar file and then add it to the class path of the web application and to the lib folder in WEB-INF, then try to persist the entity to the db i have the following exception
Code:
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: ORA-00001: unique constraint (owner.pk) violated
Note: when copy the entity class package and persistence.xml from the desktop application to the web application, everything is ok:)
thnks in advance