Hibernate version:3.0.5
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class xxx.xxx.xxx.ProfileAuditLogDetailsModel" table="PROFILE_AUDIT_LOG_DETAILS">
<!-- try native generator -->
<id name="rowId" column="ROW_ID">
<generator class="org.hibernate.id.MultipleHiLoPerTableGenerator">
<param name="table">hilosequences</param>
<param name="primary_key_column">sequencename</param>
<param name="value_column">highvalues</param>
</generator>
<!--<generator class="native"/>-->
</id>
<property name="profileId" column="PROFILE_ID"/>
<property name="logId" column="LOG_ID"/>
<property name="MPN" column="MPN"/>
<property name="awardQtyBeforeChange" column="AWARD_QTY_BEFORE_CHANGE"/>
<property name="awardQtyAfterChange" column="AWARD_QTY_AFTER_CHANGE" />
<property name="priceBeforeChange" column="PRICE_BEFORE_CHANGE"/>
<property name="priceAfterChange" column="PRICE_AFTER_CHANGE"/>
<property name="action" column="ACTION"/>
Full stack trace of any exception that occurs:
2006-05-23 02:17:58,531 DEBUG [xxx.xxx.xxx.DataServiceImpl] object saved, xxx.xxx.xxx.ProfileAuditLogDetailsModel
2006-05-23 02:17:58,609 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1, SQLState: 23000
2006-05-23 02:17:58,609 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (EQ_OWNER.PK_PROFILE_AUDIT_LOG_DETAILS) violated
Name and version of the database you are using:
Oracle 9i
Hello, we are using MultipleHiLoPerTableGenerator to generate row_id which is the PK for our profile_audit_log_details table. There might be some dirty data which causes a primary key unique constraint violation. We try to figure out which rows of the existing data in the table are causing the problem.
We know the rowId property will be populated if the ProfileAuditLogDetailsModel is saved to database successfully. But how about this scenario, saving object to the database failed because of the unique constraint violation.
Is there a way I can get the current ID which is generated by the MultipleHiLoPerTableGenerator which causes this problem?
Thanks a lot and have a great day,
Jiao
|