|
From: Colin S. <col...@ex...> - 2004-02-22 02:56:39
|
I've been sitting here all day watching logs go by as I try to get a system into production, and seeing a lot of pauses as the new JdbcTemplate(dataSource) in JdbcHelper causes, every single time JdbcHelper is created, the exception metadata to be pulled from the DB. Now this is code using Spring slightly post RC1. I realize JdbcHelper has gone away, but the same thing happens of course when you just do a 'new JdbcTemplate(dataSource)' directly. I don't know why JdbcAccessor (and hence JdbcTemplate) really needs to eager init the exception translator. The access method is synchronized, so there should be no issues letting it lazy init. I would like to remove this eager init (in afterPropertiesSet()) of the exception translator. Please let me know if you have a problem with this. I was thinking that if somebody wants to still allow it to be eagerly inited, for the case where JdbcTemplate is coming out of a beanfactory/context then we can add a 'lazyInitExceptionTranslator' property, which would default to true. Regards, Colin |