ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: How to use TypeMap correctly?
Date Fri, 08 Jun 2007 13:24:44 GMT
There's a new method .getCurrentConnection() you can use to get the
connection currently in use, whether you used .startTransaction() or
.setUserTransaction().

Clinton

On 6/5/07, Yu, Jack <Jack.Su@fmr.com> wrote:
>
>  Hi,
>
>         We are trying to handle custom types (such as Oracle Object), the
> only way we find out now is to
>         get the connection instance from SqlMapper.getDataSource().getConnection(),
>
>         and set the typeMap in that connection, and set it back using
> SqlMapper.setUserConnection.
>
>         The API document  says:
>
>         "Using a user supplied connection basically sidesteps the
> transaction manager,
>     so you are responsible for appropriately"
>
>         The reason that we call "setUserConnection" is that SqlMapper will
> eventually use "userConnection"
>         to perform the SQL transactions, and SqlMapper.getUserConnectionis deprecated,
and
>         "userConnection" value is not the same as SqlMapper.getDataSource().getConnection().
> What's the magic
>         reason under that??
>
>         is there any better way to handle it?
>
>         Thanks
>
>         -- Jack
>
>

Mime
View raw message