0 Replies Latest reply on Nov 19, 2005 6:24 PM by J-C jc

    Embedded EJB3 & DB settings

    J-C jc Apprentice

      I try to use Embedded EJB3. I have a class A and and class B that extends A. In my sample, I try to create a new B. It works fine with hsql db. Then I try to use Postgresl. I have the following exception:

      Caused by: java.sql.BatchUpdateException: L'élément du batch 0 insert into Operation (amount, notes, compte_id, state, description_id, virement_id, TYPE, id) values (1.2, NULL, NULL, NULL, NULL, NULL, 'fr.titi.tutu.B', 0) a été annulé. Appeler getNextException pour en connaître la cause.


      In fact for inheritance, when I have a look in Postgresql, the type column is a VARCHAR(10). Since the name of the class is more than 10 characters, I have an exception.

      To define my DB I add:
      bean name="SampleDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
       <property name="driverClass">org.postgresql.Driver</property>
       <property name="connectionURL">jdbc:postgresql://localhost/sample</property>
       <property name="userName">postgres</property>
       <property name="password">foo</property>
       <property name="jndiName">java:/SampleDS</property>
       <property name="minSize">0</property>
       <property name="maxSize">10</property>
       <property name="blockingTimeout">1000</property>
       <property name="idleTimeout">100000</property>
       <property name="transactionManager"><inject bean="TransactionManager"/></property>
       <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
       <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
       </bean>
      
       <bean name="SampleDS" class="java.lang.Object">
       <constructor factoryMethod="getDatasource">
       <factory bean="MoneyDSBootstrap"/>
       </constructor>
       </bean>
      


      If I was in JBoss I'll add something to add the type-mapping=Postgresql8.0. How can I add this in embedded EJB3. I do not succeed to find xml atribute to use ?

      Any suggestions are welcome !