2 Replies Latest reply on Oct 28, 2002 2:38 AM by cloudor

    Character restrications in PrimaryKey?

    cloudor

      Hi all,

      I am using a String field as the PrimaryKey for my
      entity bean. I can successfully create an entity
      using a String pk made up of Chinese characters.
      But i get a NoSuchEntityException if i try to
      iterate the result Collection return by the findAll method.

      Is that a bug? I am using jboss-3.0.3_tomcat-4.1.12.

      Thanks,
      Cloudor


      15:54:33,609 ERROR [LogInterceptor] NoSuchEntityException:
      javax.ejb.NoSuchEntityException: Entity not found: primaryKey=¶ÓÎé3
      at
      org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:170)
      at
      org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at
      org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
      at
      org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
      at
      org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
      at
      org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:262)
      at
      org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at
      org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:90)
      at
      org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
      at
      org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at
      org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at
      org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      at
      org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at
      org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at
      org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at
      org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
      at
      org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at
      org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
      at
      org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy37.getName(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at
      org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1161)

        • 1. Re: Character restrications in PrimaryKey?
          scoy

          I think that this depends on how well your database/jdbc driver combination works together to ensure that the character bytes that you write to the database are the same ones that it returns.

          Can you verify that the chinese language string is indeed present in the database?

          Does the database even support the chinese character set?

          Steve

          • 2. Re: Character restrications in PrimaryKey?
            cloudor

            Yes, I can use chinese in other field (not pk)
            without problems. I can create them in the
            database using the create method of home interface
            and see them there with a sql console. Also, I can
            fetch them and display them on jsp pages correctly.

            But if I use a chinese pk, i cannot even iterate
            the collection.