Announcement Announcement Module
Collapse
No announcement yet.
Insert TIFF as BLOB in Oracle fails, how can I configure OracleLobHandler in JPA? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Thank you very much.

    However, I'm dealing with a legacy database and I'm not allowed to include new technologies (my department is not responsible of that)

    Thanks in any case.

    Comment


    • #17
      Sorry to here that, indeed...

      I wonder, how come someone like you, work in a place like that:
      I'm not allowed to include new technologies
      .

      You seem pretty active and "progressive" blogging questions/answers here and there.

      New technologies is totally relative... For many shops out there Spring framework is a new technology vs EJB counterpart. I know we cannot control that at all.

      Any way save it for the future.
      jD

      Comment


      • #18
        Originally posted by delgad9 View Post
        Any way save it for the future.
        jD
        I'll do it.

        Thanks a lot.

        Comment


        • #19
          Update: column definition:

          Data Type:2004
          Type Name:BLOB
          Column Size:4000
          Octet Length:4000
          Nullable:YES

          Comment


          • #20
            I've tried with a @RooJpaEntity (entity jpa ... --activeRecord false) in order to see if Spring Data could manage it better, but it also fails:

            Console:
            2012-02-28 11:19:57,429 [main] DEBUG org.hibernate.util.JDBCExceptionReporter - could not insert: [com.malsolo.blobdata.domain.ImagePlain] [insert into imagen (id, ...) values (?, ...)]
            java.sql.SQLException: operación no permitida: streams type cannot be used in batching
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
            at oracle.jdbc.driver.OraclePreparedStatement.addBatc h(OraclePreparedStatement.java:4236)
            at org.apache.commons.dbcp.DelegatingPreparedStatemen t.addBatch(DelegatingPreparedStatement.java:175)
            at org.apache.commons.dbcp.DelegatingPreparedStatemen t.addBatch(DelegatingPreparedStatement.java:175)
            at org.hibernate.jdbc.BatchingBatcher.addToBatch(Batc hingBatcher.java:53)
            at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2434)
            at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2874)
            at org.hibernate.action.EntityInsertAction.execute(En tityInsertAction.java:79)
            at org.hibernate.engine.ActionQueue.execute(ActionQue ue.java:273)
            at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:265)
            at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:184)
            at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:321)
            at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:51)
            at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:1216)
            at org.hibernate.ejb.AbstractEntityManagerImpl.flush( AbstractEntityManagerImpl.java:960)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:618)
            at org.springframework.orm.jpa.SharedEntityManagerCre ator$SharedEntityManagerInvocationHandler.invoke(S haredEntityManagerCreator.java:240)
            at $Proxy30.flush(Unknown Source)
            at org.springframework.data.jpa.repository.support.Si mpleJpaRepository.flush(SimpleJpaRepository.java:3 79)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:618)
            at org.springframework.data.repository.core.support.R epositoryFactorySupport$QueryExecutorMethodInterce ptor.executeMethodOn(RepositoryFactorySupport.java :368)
            at org.springframework.data.repository.core.support.R epositoryFactorySupport$QueryExecutorMethodInterce ptor.invoke(RepositoryFactorySupport.java:349)
            at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
            at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:110)
            at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
            at org.springframework.dao.support.PersistenceExcepti onTranslationInterceptor.invoke(PersistenceExcepti onTranslationInterceptor.java:155)
            at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
            at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
            at $Proxy31.flush(Unknown Source)
            at com.malsolo.blobdata.domain.ImagePlainIntegrationT est.testSaveActualTiffImage(ImagePlainIntegrationT est.java:30)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:618)
            at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:45)
            at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
            at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:42)
            at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
            at org.springframework.test.context.junit4.statements .RunBeforeTestMethodCallbacks.evaluate(RunBeforeTe stMethodCallbacks.java:74)
            at org.springframework.test.context.junit4.statements .RunAfterTestMethodCallbacks.evaluate(RunAfterTest MethodCallbacks.java:83)
            at org.springframework.test.context.junit4.statements .SpringRepeat.evaluate(SpringRepeat.java:72)
            at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:231)
            at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:47)
            at org.junit.runners.ParentRunner$3.run(ParentRunner. java:231)
            at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:60)
            at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:229)
            at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:50)
            at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:222)
            at org.springframework.test.context.junit4.statements .RunBeforeTestClassCallbacks.evaluate(RunBeforeTes tClassCallbacks.java:61)
            at org.springframework.test.context.junit4.statements .RunAfterTestClassCallbacks.evaluate(RunAfterTestC lassCallbacks.java:71)
            at org.junit.runners.ParentRunner.run(ParentRunner.ja va:300)
            at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:174 )
            at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
            at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)
            2012-02-28 11:19:57,438 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 17090, SQLState: null

            Comment


            • #21
              And the Trace:
              org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.GenericJDBCException: could not insert: [com.malsolo.blobdata.domain.ImagePlain]; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [com.malsolo.blobdata.domain.ImagePlain]
              at org.springframework.orm.jpa.EntityManagerFactoryUt ils.convertJpaAccessExceptionIfPossible(EntityMana gerFactoryUtils.java:326)
              at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.translateExceptionIfPossible(AbstractEn tityManagerFactoryBean.java:404)
              at org.springframework.dao.support.ChainedPersistence ExceptionTranslator.translateExceptionIfPossible(C hainedPersistenceExceptionTranslator.java:58)
              at org.springframework.dao.support.DataAccessUtils.tr anslateIfNecessary(DataAccessUtils.java:213)
              at org.springframework.dao.support.PersistenceExcepti onTranslationInterceptor.invoke(PersistenceExcepti onTranslationInterceptor.java:163)
              at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
              at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
              at $Proxy31.flush(Unknown Source)
              at com.malsolo.blobdata.domain.ImagePlainIntegrationT est.testSaveActualTiffImage(ImagePlainIntegrationT est.java:30)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:618)
              at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:45)
              at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
              at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:42)
              at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
              at org.springframework.test.context.junit4.statements .RunBeforeTestMethodCallbacks.evaluate(RunBeforeTe stMethodCallbacks.java:74)
              at org.springframework.test.context.junit4.statements .RunAfterTestMethodCallbacks.evaluate(RunAfterTest MethodCallbacks.java:83)
              at org.springframework.test.context.junit4.statements .SpringRepeat.evaluate(SpringRepeat.java:72)
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:231)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:47)
              at org.junit.runners.ParentRunner$3.run(ParentRunner. java:231)
              at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:60)
              at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:229)
              at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:50)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:222)
              at org.springframework.test.context.junit4.statements .RunBeforeTestClassCallbacks.evaluate(RunBeforeTes tClassCallbacks.java:61)
              at org.springframework.test.context.junit4.statements .RunAfterTestClassCallbacks.evaluate(RunAfterTestC lassCallbacks.java:71)
              at org.junit.runners.ParentRunner.run(ParentRunner.ja va:300)
              at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:174 )
              at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
              at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)
              Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [com.malsolo.blobdata.domain.ImagePlain]
              at org.hibernate.ejb.AbstractEntityManagerImpl.conver t(AbstractEntityManagerImpl.java:1387)
              at org.hibernate.ejb.AbstractEntityManagerImpl.conver t(AbstractEntityManagerImpl.java:1315)
              at org.hibernate.ejb.AbstractEntityManagerImpl.conver t(AbstractEntityManagerImpl.java:1321)
              at org.hibernate.ejb.AbstractEntityManagerImpl.flush( AbstractEntityManagerImpl.java:963)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:618)
              at org.springframework.orm.jpa.SharedEntityManagerCre ator$SharedEntityManagerInvocationHandler.invoke(S haredEntityManagerCreator.java:240)
              at $Proxy30.flush(Unknown Source)
              at org.springframework.data.jpa.repository.support.Si mpleJpaRepository.flush(SimpleJpaRepository.java:3 79)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:618)
              at org.springframework.data.repository.core.support.R epositoryFactorySupport$QueryExecutorMethodInterce ptor.executeMethodOn(RepositoryFactorySupport.java :368)
              at org.springframework.data.repository.core.support.R epositoryFactorySupport$QueryExecutorMethodInterce ptor.invoke(RepositoryFactorySupport.java:349)
              at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
              at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:110)
              at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
              at org.springframework.dao.support.PersistenceExcepti onTranslationInterceptor.invoke(PersistenceExcepti onTranslationInterceptor.java:155)
              ... 32 more
              Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.malsolo.blobdata.domain.ImagePlain]
              at org.hibernate.exception.SQLStateConverter.handledN onSpecificException(SQLStateConverter.java:140)
              at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:128)
              at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:66)
              at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2454)
              at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2874)
              at org.hibernate.action.EntityInsertAction.execute(En tityInsertAction.java:79)
              at org.hibernate.engine.ActionQueue.execute(ActionQue ue.java:273)
              at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:265)
              at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:184)
              at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:321)
              at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:51)
              at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:1216)
              at org.hibernate.ejb.AbstractEntityManagerImpl.flush( AbstractEntityManagerImpl.java:960)
              ... 49 more
              Caused by: java.sql.SQLException: operación no permitida: streams type cannot be used in batching
              at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
              at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
              at oracle.jdbc.driver.OraclePreparedStatement.addBatc h(OraclePreparedStatement.java:4236)
              at org.apache.commons.dbcp.DelegatingPreparedStatemen t.addBatch(DelegatingPreparedStatement.java:175)
              at org.apache.commons.dbcp.DelegatingPreparedStatemen t.addBatch(DelegatingPreparedStatement.java:175)
              at org.hibernate.jdbc.BatchingBatcher.addToBatch(Batc hingBatcher.java:53)
              at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2434)
              ... 58 more

              Comment

              Working...
              X