Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to insert image more than 4K in Database

 
Vinu Valayil
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Just a shot in the dark: I hope you don't have multiple versions of these jars sitting on the classpath.
You might as well check the server classpath and see what's in place.
As mentioned by Paul before, the problem can be narrowed to the correct jar being used.

Regards, Vinu
 
Vinu Valayil
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posting this again
Hi,

Just a shot in the dark: There might be multiple versions of the same jar or conflicting jars in the server's classpath.
Could you check that as well?

Regards, Vinu

 
sk mehrotra
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tring to upload files of sizes 6K, 10K and 800K, but result is the same.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sk mehrotra wrote:Tring to upload files of sizes 6K, 10K and 800K, but result is the same.

I meant what size are they on the web server? Did you succesfully stream the whole file there in the first place?
 
sk mehrotra
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the file stored to the disk is OK.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it sounds like it is your classpath that is the issue.
 
Jan Cumps
Bartender
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you are connecting to a different database in the two tests.
Note that not all Oracle versions supporrted LOBs with more than 4K.

Can you check this? And give your table description in the database used in your web application and your test application?
 
sk mehrotra
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Table Script Used :
CREATE TABLE UPLOAD_TEST
(
ID VARCHAR2(100),
IMAGE BLOB
)
TABLESPACE TESTTBL
LOGGING
LOB (IMAGE) STORE AS
( TABLESPACE TESTTBL
ENABLE STORAGE IN ROW
CHUNK 8192
PCTVERSION 10
NOCACHE

)
NOCACHE
NOPARALLEL

And I am only connecting to the One Database.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Back to looking at the classpath then.
 
Moojid Hamid
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ENABLE STORAGE IN ROW

I am no Oracle expert, but as far as I know the max LOB size in row is 4K. could this line be causing the problem?

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That doesn't truncate the entered value it just denotes that up to 4k of the LOB should be stored inline. The rest is punted of to another location. According to sk mehrotra they have successfully managed to insert >4k via JDBC in a stand alone application so the DDL should not be affecting this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic