Spring schedule定时器中,报错hibernate could not initialize proxy - no Session
WorkOrder类中,有一个属性是级联的
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name = "CATEGORYID", referencedColumnName = "CATEGORYID", nullable = false)
private CategoryDefinition category;
在页面请求的control和service中使用正常。因为有openSessionInView
当在定时器中使用workOrder.getCategory()的时候,会报错 could not initialize proxy - no Session
请问在定时器重如何保持session