I am having trouble saving UTF-16 character to VARCHAR2 in oracle 10g
This value can be save to database from TOAD but not through hibernate
UTF-16 character (FULL_NAME)
Clarence Ofwerman, Clarence Öfwerman and Clarence Ífwerman
Even I tried with settings hibernate properties in spring context BUT still same problem
<prop key="hibernate.connection.characterEncoding">UTF-8</prop>
<prop key="hibernate.connection.useUnicode">true</prop>
But interesting thing hibernate throws unique contraint violation error
Anybody knows how to resolve this issue
Thanks
Gopal
Hibernate version: 3.2.0.ga
Mapping documents:
<property name="name" column="FULL_NAME" type="java.lang.String" />
Exception:
Hibernate: insert into INV_WORK_CONTRIBUTOR (WORK_ID, FULL_NAME, CONTRIBUTOR_ROLE, MP_TALENT_ID, MODIFIED_BY, MODIFIED_DATE, WORK_CONTRIBUTOR_ID) values (?, ?, ?, ?, ?, ?, ?)
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.LongType] - binding '2' to parameter: 1
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.StringType] - binding 'Alar Suurna' to parameter: 2
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.StringType] - binding 'Engineer' to parameter: 3
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 4
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.StringType] - binding 'EMI Ingester' to parameter: 5
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.TimestampType] - binding '2007-02-07 16:21:27' to parameter: 6
2007-02-07 16:21:27,447 DEBUG [org.hibernate.type.LongType] - binding '23' to parameter: 7
2007-02-07 16:21:27,527 ERROR [org.hibernate.util.JDBCExceptionReporter] - ORA-00001: unique constraint (GOPALINVDATA.INV_WORK_CONTRIBUTOR_U1) violated
2007-02-07 16:21:27,527 ERROR [org.hibernate.util.JDBCExceptionReporter] - ORA-00001: unique constraint (GOPALINVDATA.INV_WORK_CONTRIBUTOR_U1) violated
2007-02-07 16:21:27,537 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (GOPALINVDATA.INV_WORK_CONTRIBUTOR_U1) violated
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 39 more
|