---
title: "Session is closed !"
author: "dky_rl"
date: "2010-04-28T12:49:11Z"
tags: []
categories: ["企业架构"]
slug: "session-is-closed"
draft: false
lastmod: "2010-04-28T12:49:11Z"
id: 654980
url: "https://rosela.iteye.com/blog/654980"
---

@Transactional在struts2+spring+jpa+hibernate 
今天修改程序，我用定时器定时调用action中的一个方法。 
发现一个exception：
javax.persistence.PersistenceException: org.hibernate.SessionException: Session is closed!
原因是一个service method,or service class 没有添加annotation：@Transactional

    @Transactional
    public class UserService  {
    }