-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Saving Multiple file Uploads with Hibernate
PostPosted: Thu Apr 27, 2006 5:56 pm 
Beginner
Beginner

Joined: Sat Dec 03, 2005 11:12 am
Posts: 27
Hi,

Hibernate version: 3.1.3
Oracle JDBC Driver version - 10.2.0.1.0

I am trying to upload files and save them to database. I am using struts framework. My corresponding mapping table in database is of Blob type.
I am using @hibernate.property type = "blob" to map to blob column.
When i try to upload a single file it works fine. but, when i try to upload multiple files it doesnt work. I am using tomcat 5 as my web server.
I dont get any exceptions but the console hangs forever at

Invoking commit for transaction on gov.osc.vendrep.service.AnswerManager.saveAnswer
Triggering beforeCommit synchronization
Triggering beforeCompletion synchronization
Initiating transaction commit
Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@74d95e0b

Does hibernate has any limitations on multiple file uploads??
Any suggetions
Please help me!!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 12:31 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Hibernate knows nothing about file uploads. Your business logic is looking after that. The problem is in there, somewhere.

Lobs are notoriously hard to work with. In all probability, Oracle lobs have their own peculiarities, so starting with Oracle's help files woulde reasonable. Things to look out for include:
  1. The length of the resulting SQL statement. Some servers have restrictions on that.
  2. Use of transactions. If you've loaded an existing object with a lob in one transaction, some servers require you use the same transaction to save it again.
  3. Available memory. If you're saving 2 files, each 10Mb, you'll end up using another 20Mb when the data is put into the JDBC statement, and possibly another 20Mb, if you used Session.merge (which returns a different object with the same data).. if your JVM is configured to access only 100Mb of heap space, you could easily run out of memory.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.