没有最佳
因为他们出教程的时候SpringBoot还不是很流行,也是最近开始流行微服务框架的
和IDEA差不多
源码和详细文档在这个github上哟,https://github.com/codingXiaxw/seckill 多看看评论
没有自动提示的话,直接去maven repository复制吧。http://mvnrepository.com/artifact/com.mchange/c3p0/0.9.5.2
关于缓存问题:
http://www.cnblogs.com/zemliu/archive/2013/08/05/3239014.html
执行了2次sql查询,看似我们使用了同一个sqlSession,但是实际上因为我们的dao继承了SqlSessionDaoSupport,而SqlSessionDaoSupport内部sqlSession的实现是使用用动态代理实现的,这个动态代理sqlSessionProxy使用一个模板方法封装了select()等操作,每一次select()查询都会自动先执行openSession(),执行完close()以后调用close()方法,相当于生成了一个新的session实例,所以我们无需手动的去关闭这个session()(关于这一点见下面mybatis的官方文档),当然也无法使用mybatis的一级缓存,也就是说mybatis的一级缓存在spring中是没有作用的.
官方文档摘要
MyBatis SqlSession provides you with specific methods to handle transactions programmatically. But when using MyBatis-Spring your beans will be injected with a Spring managed SqlSession or a Spring managed mapper. That means that Spring will always handle your transactions.
You cannot call SqlSession.commit(), SqlSession.rollback() or SqlSession.close() over a Spring managed SqlSession. If you try to do so, a UnsupportedOperationException exception will be thrown. Note these methods are not exposed in injected mapper classes.
体积和性能。还有就是依赖,依赖越多量级越重。屈指可数的jar包就能完成功能的一般都是轻量级。像struts这种也说轻量级就有待考虑了。。也许是和ejb这种比的吧。。
没获取到数据
就这样 根本访问不到服务器
工程右键-》属性-》Java构建路径-》库-》双击-》执行环境-》选择合适的。 如何选择合适的?查看自己的jdk版本--->打开cmd 输入java -version 查看 选择
class path resource [spring/spring-dao.xml] cannot be opened because it does not exist
哎,好惆怅啊。。不知道为什么测试都过不了
清问各位有没有遇到类似的问题呢,怎么解决的都