<pre name="code" class="java">Session session = sessionFactory.openSession();
获取session 解决了找不到session的问题。
/**
* @Title: batchUpdateOrder
* @Description: 未支付超过2小时,订单关闭
* @param: @return 设定文件
* @return: Integer 返回类型
* @throws
*/
public Integer batchUpdateOrder(){
Integer result=0;
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs=null;
//未支付订单集合
//超过2个小时未支付,订单自动关闭
String sql="update order_details d,order_master_info m set d.order_status=4,m.order_status=2 "+
" where d.order_master_id=m.id and d.id=0 ";
//遍历分销商,保存到分期账单表中
try{
Session session = sessionFactory.openSession();
conn = SessionFactoryUtils.getDataSource(sessionFactory).getConnection();
conn.setAutoCommit(