assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
// should be ignored
dsProxy.getConnection().close();
}
catch (SQLException ex) {
throw new UncategorizedSQLException("", "", ex);
}
tt.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
// something transactional
assertEquals(con, DataSourceUtils.getConnection(ds));
try {
assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection());
assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
// should be ignored
dsProxy.getConnection().close();
}
catch (SQLException ex) {
throw new UncategorizedSQLException("", "", ex);
}
}
});
try {
assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection());
// should be ignored
dsProxy.getConnection().close();
}
catch (SQLException ex) {
throw new UncategorizedSQLException("", "", ex);
}
}
});
assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));