Hello Alexey,

The SQL-statement that JBoss tries to execute is:

anonymous wrote : Executing SQL: INSERT INTO COMPONENTFIELDVALUE (CONTRACT, COMPONENT, 
FIELDNAME, SEQUENCE, VALUE, contract, component)
  |  VALUES (?, ?, ?, ?, ?, ?, ?)

I switched the Datasource to Oracle in the meantime and got the same error. The error 
message is ORA-00957 and states, that the column is specified twice. 

Is the Hypersonic database case-sensitive ?? It's logical that you can't have two 
identical column names in the same table and I never really noticed this. The funny 
thing is that everything works fine in the Hypersonic database.

The database table only consists of 5 columns (Contract, Component, Fieldname, 
Sequence, Value).

The table has a compound primary key consisting of contract, component, fieldname and 
sequence -- contract and component are supposed to be foreign keys as well.

At the moment I'm pretty stuck. Maybe someone could give me a hint on how to solve 
this.

Error Messages:
2004-08-03 13:54:49,991 DEBUG 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ComponentFieldValue]
  |  Executing SQL: INSERT INTO COMPONENTFIELDVALUE (CONTRACT, COMPONENT, FIELDNAME, 
SEQUENCE, VALUE, contract, component)
  |  VALUES (?, ?, ?, ?, ?, ?, ?)
  | 2004-08-03 13:54:50,021 ERROR 
[org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ComponentFieldValue] Could not 
create entity
  | java.sql.SQLException: ORA-00957: duplicate column name
  | 
  |     at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
  |     at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
  |     at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
  |     at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
  |     at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
  |     at 
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
  |     at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
  |     at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
  |     at 
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
  |     at ....

ejb-jar.xml:
   <enterprise-beans>
  | 
  |       <!-- Entity Beans -->
  | 
  |       <entity >
  |          <description><![CDATA[Table Component Field Value]]></description>
  | 
  |          <ejb-name>ComponentFieldValue</ejb-name>
  | 
  |          
<local-home>webservices.interfaces.ComponentFieldValueLocalHome</local-home>
  |          <local>webservices.interfaces.ComponentFieldValueLocal</local>
  | 
  |          <ejb-class>webservices.ejb.ComponentFieldValueBean</ejb-class>
  |          <persistence-type>Container</persistence-type>
  |          <prim-key-class>webservices.ejb.ComponentFieldValuePK</prim-key-class>
  |          <reentrant>False</reentrant>
  |          <cmp-version>2.x</cmp-version>
  |          <abstract-schema-name>componentFieldValueSchema</abstract-schema-name>
  |          <cmp-field >
  |             <description><![CDATA[]]></description>
  |             <field-name>contract</field-name>
  |          </cmp-field>
  |          <cmp-field >
  |             <description><![CDATA[]]></description>
  |             <field-name>component</field-name>
  |          </cmp-field>
  |          <cmp-field >
  |             <description><![CDATA[]]></description>
  |             <field-name>fieldname</field-name>
  |          </cmp-field>
  |          <cmp-field >
  |             <description><![CDATA[]]></description>
  |             <field-name>sequence</field-name>
  |          </cmp-field>
  |          <cmp-field >
  |             <description><![CDATA[]]></description>
  |             <field-name>value</field-name>
  |          </cmp-field>
  | 
  |          </query>
  | 
  |       </entity>
  | 
  | 
  |    </enterprise-beans>
  | 
  |    <!-- Relationships -->
  |    <relationships >
  |       <ejb-relation >
  |          <ejb-relation-name>ContractAndCFValueRelation</ejb-relation-name>
  | 
  |          <ejb-relationship-role >
  |             
<ejb-relationship-role-name>CFValueHasContract</ejb-relationship-role-name>
  |             <multiplicity>Many</multiplicity>
  |             <cascade-delete/>
  |             <relationship-role-source >
  |                <ejb-name>ComponentFieldValue</ejb-name>
  |             </relationship-role-source>
  |             <cmr-field >
  |                <cmr-field-name>contractCMR</cmr-field-name>
  |             </cmr-field>
  |          </ejb-relationship-role>
  | 
  |          <ejb-relationship-role >
  |             
<ejb-relationship-role-name>ContractHasCFValues</ejb-relationship-role-name>
  |             <multiplicity>One</multiplicity>
  |             <relationship-role-source >
  |                <ejb-name>Contract</ejb-name>
  |             </relationship-role-source>
  |             <cmr-field >
  |                <cmr-field-name>componentFieldValuesCMR</cmr-field-name>
  |                <cmr-field-type>java.util.Collection</cmr-field-type>
  |             </cmr-field>
  |          </ejb-relationship-role>
  | 
  |       </ejb-relation>
  |    </relationships>

jbosscmp-jdbc.xml:

   <enterprise-beans>
  | 
  |       <entity>
  |          <ejb-name>ComponentFieldValue</ejb-name>
  | 
  |          <table-name>COMPONENTFIELDVALUE</table-name>
  | 
  |          <cmp-field>
  |             <field-name>contract</field-name>
  |             <column-name>CONTRACT</column-name>
  |         </cmp-field>
  | 
  |          <cmp-field>
  |             <field-name>component</field-name>
  |             <column-name>COMPONENT</column-name>
  |         </cmp-field>
  | 
  |          <cmp-field>
  |             <field-name>fieldname</field-name>
  |             <column-name>FIELDNAME</column-name>
  |         </cmp-field>
  | 
  |          <cmp-field>
  |             <field-name>sequence</field-name>
  |             <column-name>SEQUENCE</column-name>
  |         </cmp-field>
  | 
  |          <cmp-field>
  |             <field-name>value</field-name>
  |             <column-name>VALUE</column-name>
  |         </cmp-field>
  |       </entity>
  | 
  |    </enterprise-beans>
  | 
  |   <relationships>
  |     <ejb-relation>
  |       <ejb-relation-name>ContractAndCFValueRelation</ejb-relation-name>
  | 
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>CFValueHasContract</ejb-relationship-role-name>
  |           <fk-constraint>true</fk-constraint>
  |               <key-fields/>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>ContractHasCFValues</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>contract</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |     <ejb-relation>
  |       <ejb-relation-name>ComponentAndCFValueRelation</ejb-relation-name>
  | 
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>CFValueHasComponent</ejb-relationship-role-name>
  |           <fk-constraint>true</fk-constraint>
  |               <key-fields/>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>ComponentHasCFValue</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>component_id</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |   </relationships>

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

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


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to