Could not open Hibernate Session for transaction

问题描述:

首次访问网站报错误HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin transaction failed:,刷新后正常.

Could not open Hibernate Session for transaction_第1张图片

解决方案:
给jdbc url加autoReconnect=true
找到数据库连接的jdbc url,我的在db.properties文件内,把下面这行加到url后面:

?&useUnicode=true&characterEncoding=utf-8&autoReconnect=true

你可能感兴趣的:(Hibernate)