当我使用HibernateSession类的load方法时,我得到以下异常,如下所示:
getCurrentSession().load(entityClass, id);.
如果我使用以下内容,我没有得到例外:
getCurrentSession().get(entityClass, id);.
这是类代码
package com.company.x.y.field;
@Entity
@Table(name = "FIELD")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "FIELDTYPE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="xEntity")
public abstract class AbstractField extends AbstractEntity {
private static final long serialVersionUID = 1L;
private final ValueType valueType;
private final FieldType fieldType;
private DataPoint dataPoint;
private String name;
private String title;
private String guid;
private boolean deleted;
private Integer sequence;
protected AbstractField(FieldType fieldType, ValueType valueType) {
this.fieldType = fieldType;
this.valueType = valueType;
}
@Id
@SequenceGenerator(name = …Run Code Online (Sandbox Code Playgroud) 我们在应用程序中使用的是primefaces 2.2.1版本。我们想将会话中存储的视图数量限制为3。我将web.xml配置为:
<context-param>
<description>State saving method: 'client' or 'server' (=default).See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<description>The maximum number of logical views (GET requests) to store per session (http://tinyurl.com/yw6f2e)</description>
<param-name>com.sun.faces.numberOfLogicalViews</param-name>
<param-value>3</param-value>
</context-param>
<context-param>
<description>The maximum number of JSF views (POST requests) stored in the session for per logical view (http://tinyurl.com/yw6f2e)</description>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>3</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
看来,此配置无法正常工作。当我查看内存堆转储时,我发现会话中存储了15个视图。
使用Primefaces 2.2.1,在Mojarra 2.0.9上运行的JSF 2.0.9
有任何想法吗...