[jboss-user] [JBoss Seam] - EJB3, NVARCHAR2 and Oracle10g

vijayamaladoss do-not-reply at jboss.com
Wed Nov 7 01:53:06 EST 2007

I am using Seam 2.0 and when I try  mapping a existing table nvarchar2 column to a EJb3 entity attribute, I am getting a following exception.

  |    [testng] javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: CITY, expected: varchar2(255)

 I googled and searched the forum(hibernate), but nothing solved my problem.  I have set the defaultNChar flag both in hibernate(persistence.xml) and datasource.xml.

I even tried the columnDefinition suggested in seam forum. Below is the persistence.xml I am using.

  |   <persistence-unit name="hain">
  |       <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |       <jta-data-source>java:/hainDatasource</jta-data-source>
  |       <properties>
  |          <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
  |          <property name="hibernate.hbm2ddl.auto" value="validate"/>
  |          <property name="hibernate.show_sql" value="true"/>
  |          <property name="jboss.entity.manager.factory.jndi.name" value="java:/ChainEntityManagerFactory"/>
  |          <property name="hibernate.default_schema" value="hodb"/>
  |          <property name="hibernate.connection.defaultNChar" value = "true"/>
  |       </properties>
  |    </persistence-unit>
  | </persistence>


  |    <local-tx-datasource>
  |       <jndi-name>hainDatasource</jndi-name>
  |       <connection-url>jdbc:oracle:thin:@ts-dev:1521:tcdev</connection-url>
  |       <driver-class>oracle.jdbc.OracleDriver</driver-class>
  |       <user-name>user</user-name>
  |       <password>password</password>
  |       <connection-property name = "oracle.jdbc.defaultNChar">true</connection-property>
  | </datasources>

Is there any standard way defined in EJB3?. I refered both Pro EJB and EJB in Action books. But both didnt help.

Thanks in Advance

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102413#4102413

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102413

More information about the jboss-user mailing list