Uploaded File, passing to EJB, memory size

R

RobM

Greetings

Have Tomcat -> Jboss -> Oracle database, using Struts within Tomcat. Looking
at uploading a file via struts <html:file...> which ends up via "FormFile"
interface within the struts form bean. This is fine, methods are
"getFileData" (returns whole file) or "getInputStream" (returns inputstream
to uploaded data). File is stored on database via EJB.

Thing is, considering best way to pass to EJB. Previously have passed full
data byte array (getData) to stateless EJB which writes to DB, ensuring
small file size. Now these could be larger files. I've read elsewhere
someone tried calling a stateful ejb to return an outputstream to the db
back to the web tier (action bean) which then subsequently called the same
ejb writing to the outputstream. But that sounds a bit unwieldy, passing
outputstream about to different tiers (didnt know this was good) and looking
afte stateful beans. But this may be the only way apart from passing the
full file in memory as byte array argument to the EJB function (almost wish
we were writing directly to the database from the web tier in this case -
i.e. outputstream - and not having to call an ejb!).

Best way to pass an uploaded file to EJB ?

ideas appreciated

Cheers
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top