These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Inserting UTF-16 character set in Oracle 10g VARCHAR2 type
PostPosted: Wed Feb 07, 2007 9:08 pm 
Newbie

Joined: Tue Dec 13, 2005 6:47 pm
Posts: 7
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.