geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Bessmertnyj <denis.bessmert...@gmail.com>
Subject Re: Geronimo connection pool, Spring + Hibernate and Oracle Blobs
Date Thu, 23 Apr 2009 06:16:20 GMT
finally we found solution which works.
maybe it will be useful for someone.

getJdbcTemplate().update(
              "Insert into ...values (?,?,?,?,?,?,?,?,?)",
              new Object[] {new SqlLobValue(getBlobByteArray()), ...},
              new int[] {Types.BLOB});

It uses DefaultLobHandler, which works fine for us with Geronimo connection
pool.


On Thu, Apr 23, 2009 at 10:51 AM, Denis Bessmertnyj <
denis.bessmertnyj@gmail.com> wrote:

> Hi Guys,
>
> We have problem with oracle blobs saving when we use Geronimo connection
> pool from our Spring application.
> We have something like this
>
> final OracleLobHandler lobHandler = new OracleLobHandler();
> lobHandler.setNativeJdbcExtractor(new SimpleNativeJdbcExtractor());
>
>     jdbcTemplate.execute("Insert into ....(.....) values
> (?,?,?,?,?,?,?,?,?)", new
>
> AbstractLobCreatingPreparedStatementCallback(lobHandler) {
>         @Override
>          protected void setValues(PreparedStatement ps, LobCreator
> lobCreator) throws SQLException,
>              DataAccessException {
>              lobCreator.setBlobAsBytes(ps, 5, ...);
> }
>
> This part of code works fine with well known connection pools, but not with
> geronimo when we trying to save blobs.
> Maybe someone had the same problem? How you resolved it? Did you write your
> own extractor for geronimo pool? If yes, may you share with us.
>
> Actually, is it possible to change geronimo connection pool to something
> else, but still use Geronimo JNDI to access that pool, i.e. change pool on
> server side?
>
> thanks,
>
> -
> Denis
>

Mime
View raw message