|
From: Colin S. <col...@ex...> - 2004-05-03 18:18:53
|
j=FCrgen h=F6ller [werk3AT] wrote: >That looks interesting! I didn't think about overloaded SqlParameter con= structors before; that definitely makes sense. How to you handle the LobC= reator lifecycle there? LobCreator.close needs to be invoked after Prepar= edStatement execution (but before transaction completion). > >BTW, I've recently refined the LOB support for jdbc.core: There are Abst= ractLobCreatingPreparedStatementCallback and AbstractLobStreamingResultSe= tExtractor classes now (don't we love our class naming patterns!), to mak= e LOB handling via JdbcTemplate more convenient. Have a look at imagedb's= DefaultImageDatabase class for usage examples. > >There's also a ClobStringType class in our Hibernate support, for storin= g String properties in CLOB fields. That allows to transparently store lo= ng Strings in Oracle CLOBs respectively MySQL text fields, for example. I= t registers a TransactionSynchronization for the LobCreator.close call, s= o just works within a Spring transaction. > =20 > I've been trying to convince Gavin for ages to make it possible to lazy=20 load columns (not just collections), which would make stuff like=20 ClobStringType a lot more useful. Right now if you have a table with a=20 LOB column and use something like ClobStringType you pay the price and=20 load it even if you don't need it. Oh well... |