0 Replies Latest reply on Jul 24, 2002 2:58 PM by Alex Borshik

    Character Sets & Firebird JCA

    Alex Borshik Newbie

      Hi all,

      Sorry for the cross-post. Posted in Persistence & CMP forum yesterday but I think this is the relevant forum.

      Can anyone please explain to me why the following exception is being thrown when I try to retreive an entity bean that is being persisted in Firebird.

      The field which is causing this problem is a custom class. I am using the standard InterBase type mapping in my jbosscmp-jdbc.xml file. (Java objects stored in VARCHAR(2000) column)

      The character set I chose when creating the database was NONE. I have scoured the DTD's and forums trying to find information about how to specify the character set required in my firebird-service.xml file but have not been able to locate anything.

      I can create an entity bean fine, the problem occurs when I then try to load the entity.

      21:29:38,063 DEBUG [LogInterceptor] InvokeHome: findNotAssigned()
      21:29:38,063 DEBUG [FBManagedConnection] XAResource requested from FBManagedConnection
      21:29:38,063 DEBUG [FBManagedConnection] start called: XidImpl [FormatId=257, GlobalId=cheech//7, BranchQual=1]
      21:29:38,063 DEBUG [GDS_Impl] op_transaction
      21:29:38,063 DEBUG [XdrOutputStream] writeSet: type: 3
      21:29:38,063 DEBUG [XdrOutputStream] writeSet: value: 9
      21:29:38,103 DEBUG [XdrOutputStream] writeSet: value: 6
      21:29:38,103 DEBUG [XdrOutputStream] writeSet: padding 0 : 1
      21:29:38,103 DEBUG [GDS_Impl] sent
      .
      . Lots more GDS_Impl messages
      .
      21:29:38,303 DEBUG [GDS_Impl] received
      21:29:38,303 DEBUG [FBManagedConnection] preparing sql: SELECT TITLE, FIRST_NAME, LAST_NAME, DAY_PHONE, EVE_PHONE, ADDRESSDATA, TIME_STAMP, REFERRER, DATA_PROTECT, EMAIL, BUDGET_AMOUNT, REPLACEMENT_POLICY, ADDITIONAL_PROPERTIES, WORKGROUP_ID FROM CASES WHERE (ID=?)
      21:29:38,303 DEBUG [GDS_Impl] op_prepare_statement
      21:29:38,303 DEBUG [GDS_Impl]
      .
      . Lots more GDS_Impl messages
      .
      21:29:38,373 DEBUG [FBManagedConnection] XAResource requested from FBManagedConnection
      21:29:38,373 DEBUG [FBManagedConnection] End called: XidImpl [FormatId=257, GlobalId=cheech//7, BranchQual=1]21:29:38,443 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
      java.sql.SQLException: fetch problem: org.firebirdsql.gds.GDSException: arithmetic exception, numeric overflow, or string truncation
      Cannot transliterate character between character sets
      at org.firebirdsql.jdbc.FBResultSet$FBStatementFetcher.next(FBResultSet.java:2535)

      at org.firebirdsql.jdbc.FBResultSet.next(FBResultSet.java:157)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:122)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:495)
      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:310)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:193)
      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:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:296)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy82.getId(Unknown Source)
      at com.osiron.lab.model.facade.CaseProcessorBean.findUnassignedCases(CaseProcessorBean.java:72)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:705)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      at sun.rmi.transport.Transport$1.run(Transport.java:152)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
      at java.lang.Thread.run(Thread.java:484)



      I have tried to resolve this problem by using a BLOB column in my database & changing the type-mapping for java.lang.Object in jbosscmp-jdbc.xml to store the attribute, but when I tried this approach I was getting an SQLException ("Unable to load a ResultSet column into a variable of type com.osiron.lab.model.dataviews.AddressData") thrown by the getResult method of the JDBCUtil class.

      ========================================================

      System configuration:

      JBoss 3.0.0
      Firebird 1.0
      Firebird JCA-JDBC connector 1.0

      (All using default configuration, apart from deployment of firebird connector in JBoss)

      ========================================================

      Q1) Is there any way to specify what character set the JCA connector should use? If not will I need to recreate my database using a specfic character set?

      Q2) What is the reason for storing cmp fields of type java.lang.Object in a VARCHAR(2000) and not in a BLOB column?


      Thanks