1 Reply Latest reply on Jun 20, 2002 1:17 PM by dsundstrom

    saving objects in Oracle 8 with JBoss 3

    asauve

      I posted this question in the mail group but with no reply, therefore I am reposting it here in hopes that someone out there can give me a hand with this...


      Well I have a little more information on this issue if someone would be kind enough to help... The exact version of Oracle that I am using is 8.1.7.0.0... So I wrote a very simple CMP bean, that is to store a custom object that is Serializable (this object is very simple and only contains 2 Strings and one integer), and I get the same error as below for the new CMP bean as well... I tried changing the type in the data mappings in standardjbosscmp-jdbc.xml to LONG RAW and still no luck with retrieving the object... I am now going to try the CMP examples... Hopefully they work... I have the code for the CMP bean and the tests that I just wrote if that would be of any help... This worked on the RI!

      Thanks for any suggestions,
      Alex


      asauve wrote:

      Well I have 2 objects to store into an Oracle 8 database, the one giving me the headaches right now is an object (TestTask) that is extended from an object called Task... Task is really an abstract class that implements the Serializable interface... TestTask extends Task implementing some of the methods and it as well implements the Serializable interface... Obviously TestTask is treated as a Task by the CMP bean... There is no problem storing the Task(TestTask) into the database but when you go to modify any of the other fields in a record you will get the following error:

      13:30:28,966 ERROR [STDERR] Caused by: java.rmi.ServerException: Internal error getting results for field member task
      Embedded Exception
      Unable to load to deserialize result: java.io.StreamCorruptedException: invalid stream header; nested exception is:
      javax.ejb.EJBException: Internal error getting results for field member task
      Embedded Exception
      Unable to load to deserialize result: java.io.StreamCorruptedException: invalid stream header
      13:30:28,990 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:119)
      13:30:28,992 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:242)
      13:30:28,994 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      13:30:28,996 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      13:30:28,998 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      13:30:29,000 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      13:30:29,002 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:296)
      13:30:29,004 ERROR [STDERR] at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      13:30:29,006 ERROR [STDERR] ... 24 more
      13:30:29,010 ERROR [STDERR] Caused by: javax.ejb.EJBException: Internal error getting results for field member task
      Embedded Exception
      Unable to load to deserialize result: java.io.StreamCorruptedException: invalid stream header
      13:30:29,012 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:360)
      13:30:29,014 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304)
      13:30:29,015 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:142)
      13:30:29,018 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      13:30:29,019 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:495)
      13:30:29,021 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
      13:30:29,023 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
      13:30:29,025 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:310)
      13:30:29,029 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      13:30:29,035 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:193)
      13:30:29,037 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      13:30:29,039 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      13:30:29,041 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      13:30:29,042 ERROR [STDERR] ... 31 more
      13:30:29,069 WARN [LocalTxConnectionManager$LocalConnectionEventListener] prepare called on a local tx. You are not getting the semantics you expect!


      Does the CMP 2.0 in jboss retrieve the entire record to modify one field??? Well if anyone has any ideas I would be greatly appreciative....

      Thanks,
      Alex

        • 1. Re: saving objects in Oracle 8 with JBoss 3
          dsundstrom

          I fixed this for 8.1.7, but it will not work for 9 (9 is totally different). You can get the fix from cvs (Branch_3_0 or HEAD).

          The problem is Oracle limits streams to 4k so when it is reloaded it is truncated and therefore corrupted.

          BTW, you would better off using a mapped DVC, which would store the two strings and integer into 3 separate columns. The JBossCMP documenation ($10) covers this.