4 Replies Latest reply on Apr 20, 2006 7:52 AM by oglueck

    Sporadic CMP insert failures from LOB columns

    Craig Berry Newbie

      We are using JBoss 3.2.5, Oracle 10g on Solaris, and the Oracle 10g drivers. This behavior has occurred with both thick and thin drivers.

      Very occasionally, and for no reason we can determine, insertion of a new CMP bean containing a BLOB or CLOB element will fail with an exception like the one below. It seems to happen more often for BLOBs than CLOBs, but it's so rare that might not mean anything. We can run our unit tests literally hundreds of times without seeing it, then we'll see it happen once, then it will disappear again.

      The jdbc-type for the LOB columns is set appropriately (CLOB or BLOB) in all cases, as evidenced by the fact that it works properly more than 99% of the time.

      I have looked around for information on this, but have found references only to solid, reproducible problems with storing long (4kB+) data. We do store long data, but again, it works most of the time, so I think we have our configuration set up correctly.

      Any help on this would be greatly appreciated. The top of the stack trace from an example failure follows:

      Could not create entity:java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
      
      javax.ejb.CreateException: Could not create entity:java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
      
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:305)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:137)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:562)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:203)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:269)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:576)
      at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1061)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:204)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:214)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:94)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:478)
      at org.jboss.ejb.Container.invoke(Container.java:743)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:294)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy127.create(Unknown Source)
      at com.portblue.model.creation.resource.TestAttachmentBean.createAttachment(TestAttachmentBean.java:215)