你是不每次调用时又重新注册了数据源

解决方案 »

  1.   

    谢谢kypfos的关注不过确实是只注册了一次我觉得是tomcat作了什么特别操作,因为BasicDataSourceFactory的说明就是:
    JNDI object factory that creates an instance of BasicDataSource that has been configured based on the RefAddr values of the specified Reference, which must match the names and data types of the BasicDataSource bean properties就应该是每次lookup的时候,都生成一个实例,感觉还是tomcat作了一些特别的处理我现在想用一个static的HashMap把数据源都存起来,一个数据源只lookup一次,以后都
    从HashMap理读取总是感觉自己没弄明白什么,哎~