title: Oracle Blobs - store size or calculate?
body: <p>I am writing a generic Http resource hosting service and am storing larger objects as BLOBs in an Oracle database.  I want to be able to set the 'Content-Length' header when returning a stored object, which means I need to know the size of the BLOB before I start writing it to the client (I know I could use chunked-encoding, and am in some cases).  Does anyone have any experience with the performance impact calling dbms_lob.getlength() will have on every read or should I calculate the BLOB size on INSERT and store it in the table?  On average I'd expect write rates to be higher then read rates.  I'm writing a benchmark right now to try and see what the impact is, but it seems like such a common question I thought someone might have already figured this out.  Also, using JDBC/Spring 3, how would I even calculate the BLOB size on write? (and I can't use triggers or stored procedures) Thanks.</p>