Just a small performance modification:

Since the type of the object returned by the statement

statement.getBlob(2);

is "oracle.sql.BLOB", one could have an instance variable

protected java.lang.reflect.Method blobGetOutStreamMethod;

and in OracleRDBMSAdapter's constructor

// only need to lookup the method once
Class bCls = Class.forName("oracle.sql.BLOB");
blobGetOutStreamMethod =
     bCls.getMethod("getBinaryOutputStream", new Class[] {});

Then in the storeContent method one would have:

...
Object bObj = statement.getBlob(2);
OutputStream os = null;
try {
  os = (OutputStream)m.invoke(bObj, new Object[] {});
} catch (Exception ex) {
....

which eliminates the getClass and method lookup calls.

Also, just to make sure resources get freed up:

change
        if (tempFile != null) {
            is.close();
            is = null;
            tempFile.delete();
        }
    } finally {

to
    } finally {
        if (tempFile != null) {
            try {
                is.close();
            } catch (Exception ex) {
                // ignore
            }
            is = null;
            if (! tempFile.delete()) {
              logger.log("Could not delete file \""
                + tempFile.getAbsolutePath()
                + "\"");
            }
        }




Richard



Davide Savazzi wrote:
On Thursday 11 November 2004 00:03, Richard Emberson wrote:

This may not be the long term solution, but it works for both small
and large files.
My environment is: I am running Slide from a war file within an
ear file in JBoss.


Thanks for the patch! Tomorrow I'll test it in my environment and then commit it :)



--
This email message is for the sole use of the intended recipient(s) and
may contain confidential information.  Any unauthorized review, use,
disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all
copies of the original message.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to