https://stackoverflow.com/questions/35290962/hibernate-createcriteria-is-not-valid-without-active-transaction
自己看吧,需要
@Transactional
或者显示的开启事务。