• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Blob Problem on OAS 10.1.2.0.2

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello! I'm developing an application using Oracle Application Server 10.1.2.0.2 (which uses J2EE 1.3 spec), Hibernate (3.2), Java 1.4.2 and Oracle 10g Database, which I connect to with a datasource configured in my application (the config is at the end of the post).

The problem is: I have a Blob Column on a table and I can write data to it, but I can't load data from it. For test purposes, I ran the application on Tomcat 5.0.28 and the Blob data is there (~130KB), but doing the same thing on OAS didn't work (I only got 86 bytes , and no errors ). The thing is: when the data was saved, I was using OAS.

Any ideas?

Oh, one more thing... I cannot change the application server on the client (neither its version).



[ August 26, 2008: Message edited by: Marco Tulio Borges ]

I have to edit this so I can say that I found out that 86 bytes is the size of the Blob locator on Oracle DB, so I'm getting nothing when loading my blob in OAS...
[ August 27, 2008: Message edited by: Marco Tulio Borges ]
 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After much work, I found a solution... Actually, not one, but three! After many changes in my search terms on Google, one post with 3 solutions came to me: Storing Images with Oracle and Hibernate (Paperplanes). The actual problem is the way the Blob was mapped to Java: I have a byte[] mapped to it. The weird thing is that in Tomcat this was handled and in OAS this was not... Anyway, the solution is to use a Spring implementation of a Hibernate UserType that maps Blobs to byte[]. I still have to test this solution for inserting data in the Blob, but I'm confident that it will work. If it doesn't, this forum will hear from me tomorrow. Spring rules! Thanks to Mathias Meyer, the guy from Paperplanes, who helped me and probably doesn't know yet.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done and thank you for giving us the other link.
 
reply
    Bookmark Topic Watch Topic
  • New Topic