iteye_867 2011-01-06 09:37
浏览 202
已采纳

关于jdbcTemplate的疑问

[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交互的。请强人指教,谢谢!!!

  • 写回答

5条回答 默认 最新

  • beneo 2011-01-07 08:28
    关注

    恩,以前依照源代码为准,我前面是臆想

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料