ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Osbaldeston <richard.osbaldes...@wordmap.com>
Subject Re: Access to the underlying connection
Date Tue, 19 Apr 2005 10:56:17 GMT
I'm Not Sure how that helps me, I'm not using SqlMaps only the DAO 
Framework so my daos extend JdbcDaoTemplate which dosnt have 
getSqlMapTransactionManager or getters for any TransactionManager or 
IBatis DaoManagers (protected). I suppose I could write my own 
JdbcDaoTemplate to add an accessor, but does 
getSqlMapTransactionManager().getCurrentConnection() return the oracle 
jdbc connection or just the iBatis proxied one I already have?

- Richard

Guido García Bernardo wrote:

> What I do is:
>
> Connection jdbcConnection = null;
> ResultSet rs = null;         try {
>    jdbcConnection = 
> getSqlMapTransactionManager().getCurrentConnection();             
> DatabaseMetaData dbmd = jdbcConnection.getMetaData();
>    ...
>    // JDBC code
>    ...
> } catch (SQLException sqle) {
>    ...
> } finally {
>    try { rs.close(); } catch (Exception e) {}     // Not close 
> jdbcConnection (DaoManager does it for us)
>    // try { jdbcConnection.close(); } catch (Exception e) {}
> }
>
> I don't know if it has collateral effects.  ¿Does anyone know what are 
> the implications or drawbacks of this aproach?
> Thank you,
> Guido García Bernardo.



Mime
View raw message