• Post Reply Bookmark Topic Watch Topic
  • New Topic

Blob Problem on OAS 10.1.2.0.2  RSS feed

 
Marco Tulio Borges
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done and thank you for giving us the other link.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!