0 Replies Latest reply on Apr 12, 2002 3:38 AM by Erik Turesson

    Blob and Jboss 3.0 beta 2

    Erik Turesson Novice

      Hello!

      I am using the latest JBoss 3.0 from CVS and the default hypersonic database.
      I have on attribute in a CMP 2.0 entity bean that is a Blob. It is implemented using the ByteArrayBlob class that implements the java.sql.Blob interface.

      It works fine to store small images in that blob. I have managed to store an image that is 26 kB. However if I tries to store an image that is 69 kB if fails. I do not know exactly where the limit is, but it is somewhere between 26 kB and 69 kB.

      I get the following error message in the log:

      2002-04-12 08:53:58,479 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.SequenceBean] Executing SQL: SELECT number FROM SEQUENCEBEAN WHERE (id=?)
      2002-04-12 08:53:58,489 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ImageBean] Create: pk=7
      2002-04-12 08:53:58,489 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ImageBean] Executing SQL: SELECT COUNT(*) FROM IMAGEBEAN WHERE id=?
      2002-04-12 08:53:58,489 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ImageBean] Executing SQL: INSERT INTO IMAGEBEAN (id, name, photographer, description, imageDate, thumbnailImage, image, largeImage, hasLargeImage, largeImageWidth, largeImageHeight, largeImageSize, imageWidth, imageHeight, imageSize, storeInDb) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2002-04-12 08:53:58,530 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ImageBean] Could not create entity
      java.sql.SQLException: Connection is broken
      at org.hsqldb.Trace.getError(Trace.java:180)
      at org.hsqldb.Trace.getError(Trace.java:144)
      at org.hsqldb.Trace.error(Trace.java:205)
      at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:904)
      at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
      at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:686)
      at org.hsqldb.jdbcStatement.executeUpdate(jdbcStatement.java:85)
      at org.hsqldb.jdbcPreparedStatement.executeUpdate(jdbcPreparedStatement.java:152)
      at org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeUpdate(PreparedStatementInPool.java:887)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCreateEntityCommand.java:196)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:131)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:391)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:239)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:231)
      at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:564)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1063)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:230)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:176)
      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.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:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:472)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:243)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invoke(BaseLocalContainerInvoker.java:367)
      at $Proxy57.create(Unknown Source)
      at com.proventek.publ.image.implementation.ImageCollectionBean.addDataBaseImage(ImageCollectionBean.java:197)
      at com.proventek.publ.image.implementation.ImageCollectionBean.addImage(ImageCollectionBean.java:163)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:648)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:147)
      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:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:308)
      at org.jboss.ejb.Container.invoke(Container.java:682)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
      at $Proxy91.addImage(Unknown Source)
      at scj_images._jspService(scj_images.java:212)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:326)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:595)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1357)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1309)
      at org.mortbay.http.HttpServer.service(HttpServer.java:744)
      at org.jboss.jetty.Jetty.service(Jetty.java:527)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:743)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:916)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:758)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:145)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
      at java.lang.Thread.run(Thread.java:484)


      Whats wrong?

      /Erik Turesson