说明两种获取Session对象的方法会自动关闭可以用这个例子不是更好点
session=sessionFactory.getCurrentSession();Stundents stu=new Stundents(1, "老张", "男", new Date(), "武当山上");Stundents st=new Stundents(2, "l3l", "男", new Date(), "武当山上");session.save(stu);session.save(st);
session=sessionFactory.openSession();Stundents stu=new Stundents(1, "老张", "男", new Date(), "武当山上");Stundents st=new Stundents(2, "l3l", "男", new Date(), "武当山上");session.save(stu);session.save(st);