db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Questions about CallableLocatorProcedures.java (was: Re: [jira] Updated: (DERBY-2495) Create framework for ...)
Date Fri, 11 May 2007 17:58:37 GMT
"Kristian Waagan (JIRA)" <jira@apache.org> writes:

> Committed 'blobframework_v2.diff' to trunk with revision 529185.
>
> Very nicely commented patch Øystein!

OK, so I'm more than three weeks late to review the patch... :)

Anyway, I came across CallableLocatorProcedures.java and a couple of
questions came to mind:

A) It seems to contain a lot of almost identical code for CLOBs and
BLOBs. Would it make sense to reuse some of it instead of duplicating
it? For instance, blobCreateLocator() and clobCreateLocator() have
exactly the same structure, and could have been written as a generic
lobCreateLocator() which took a CallableStatement, the SQL text and the
holdability as parameters. blobCreateLocator() and clobCreateLocator()
could be just wrappers are around the generic method. The same comment
also applies to [bc]lobReleaseLocator, [bc]lobGetPositionFromLocator,
[bc]lobGetLength and [bc]lobTruncate. I think this could reduce the size
of the file considerably, and it would also be easier to maintain it.

B) Why does blobCreateLocator() get the holdability from the connection,
whereas clobCreateLocator() always uses non-holdable cursors?

-- 
Knut Anders

Mime
View raw message