2 Replies Latest reply on Aug 21, 2002 4:18 AM by arshish

    OLE Object field in MSAcces CMP gen'd CREATETABLE statemnt w

    arshish

      Hi,

      I am using JBoss 3.0.0, with MS Access 2000.

      I have an entity bean named HierarchyNode with a simple 1:1 relationship to itself (parent-child).

      The relationship is defined in my ejb-jar.xml and jbosscmp-jdbc.xml. Now, in the database table that gets created, I see two columns instead of one for the relationship's foreign key. One is of type Integer (as expected). The other, strangely, is of type 'OLE Object'.

      Here is the generated SQL for creating the table:
      02:46:50,469 DEBUG [HierarchyNodeEJB] Executing SQL: CREATE TABLE HIERARCHY_NODE (ID INTEGER NOT NULL, NODE_ID INTEGER NOT NULL, PATH_ID INTEGER NOT N
      ULL, parent OLEOBJECT, PARENT_ID INTEGER, CONSTRAINT pk_HIERARCHY_NODE PRIMARY KEY (ID))

      When I try inserting a record into this table via the create method of my entity bean, I get the following exception:

      03:06:46,158 DEBUG [HierarchyNodeEJB] Executing SQL: INSERT INTO HIERARCHY_NODE (ID, NODE_ID, PATH_ID, parent, PARENT_ID) VALUES (?, ?, ?, ?, ?)
      03:06:46,168 ERROR [HierarchyNodeEJB] Could not create entity
      javax.ejb.EJBException: Internal error setting parameters for field parent
      Embedded Exception
      [Microsoft][ODBC Microsoft Access Driver]Invalid SQL data type
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:289)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbstractCMPFieldBridge.java:262)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:192)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:450)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:579)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1116)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:257)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:227)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy26.create(Unknown Source)
      at com.k3.test.client.TestHierarchyNode.executeTest(TestHierarchyNode.java:49)


      I have attached my standardjbosscmp-jdbc.xml along with my ejb-jar.xml and jbosscmp-jdbc.xml files.

      I sincerely appreciate any insight into why the ole object column is being created, and how I may suppress it from being created and populated.

      Thanks,

      - Arshish Kapadia