|
From: Andrew <And...@kv...> - 2005-01-24 07:40:59
|
On Sun, 23 Jan 2005 15:23:48 +0100, Juergen Hoeller wrote: > That behavior of WebSphere's connection pool and transaction coordinator > is quite odd... It implictly marks a connection pool as non-global based > on non-transactional access?? We don`t found any clear description of Local Transaction Containment boundary... All of we found on InfoCenetr is Local transaction containment (LTC): WebSphere Application Server http://publib.boulder.ibm.com/infocenter/wasinfo/topic/com.ibm.wasee.doc/info/ee/ae/cjta_loctran.html But when we subclass JdbcTemplate and prevent super.afterPropertiesSet(), all works just fine (LTC are not started on app startup). > > I've added a "lazyInit" bean property to JdbcAccessor, allowing to enforce > lazy initialization of the SQLExceptionTranslator. This will be part of > Spring 1.1.4, scheduled for Monday (provided that SourceForge manages to > fix its file release facility, which has been broken for a week now). > > Juergen > Thanks. > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf Of > Andrew > Sent: Friday, January 21, 2005 3:14 PM To: > spr...@li... Subject: > [Springframework-developer] WebSphere + JdbcTemplate + startup > > > 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. > > |