|
From: Andrew <And...@kv...> - 2005-01-21 15:00:22
|
We have little problem running Spring under WebSphere AS 5.0 (precisely, we use spring framework (with mvc) under the WS Portal). The problem relates to WS transactions implementation and JdbcTemplate (precisely, JdbcAccessor). WS starts LTC (Local Transaction Containment) for J2EE components (EJB or servlet) when we first time accessing DB without global transaction (UserTransaction). We don`t use EJBs at all, so WS creates only one LTC - for our servlet (portlet). But LTC can`t coexists with global transaction (we cant use the following sequence during request dispatching: get Conn -> access DB -> close Conn -> start UserTransaction <- BUG). In all of our DAO beans we`v used global transactions (JtaTransactionManager + AOP) with XA resources. All works just fine, but the application startup. When spring is loaded and instantiates JdbcTemplate, it calls JdbcTemplate.afterPropertiesSet(). This method initialize ExcpetionTranslator which access DB meta data. So, WS starts LTC! In following request processing we tray to start UserTransaction and faced the exception. So, it would be nice to add support for lazy ExcpetionTranslator initialization in JdbcTemplate (JdbcAccessor)... Thanks. |