[quote]Instances of the JdbcTemplate class are threadsafe once configured. This is important because it
means that you can configure a single instance of a JdbcTemplate and then safely inject this shared
reference into multiple DAOs (or repositories). The JdbcTemplate is stateful, in that it maintains a
reference to a DataSource, but this state is not conversational state.[/quote]
上面的文字摘自spring reference.大意是说jdbcTemplate类本身是线程安全的,但是他本身又是有状态的,spring上下文中它有可以是单例的,不是很清楚它内部是怎么在多线程环境中保持线程安全的。因为他底层的datasource是有状态的,也就是说我不是很清楚jdbcTemplate是怎么在多线程环境中跟datasource交互的。请强人指教,谢谢!!!