error hibernate failed to lazily initialize a collection of role

failed to lazily initialize a collection of role: com.ipi.bean.Dologs.DtldologsSet, no session or session was closed

q> Waw error ketika nambahin @OneToMany pada header Dologs

q> @ManyToOne

@JoinColumn(name="DTL_NO_DOLOG", referencedColumnName="HDR_NO_DOLOG", insertable = false, updatable = false)
@ManyToOne(cascade=CascadeType.ALL)
private Dologs dologs;

q> Sebelumnya

@OneToMany(mappedBy="dologs")
private Set<TrioH100Dtldologs> dtlDologsSet;

q> Sesudah ditambahin fetch=FetchType.EAGER , error menghilang

@OneToMany(fetch=FetchType.EAGER,mappedBy="dologs")
private Set<TrioH100Dtldologs> dtlDologsSet;

Published by

saifiahmada

Begin a big Process with a bit trying

2 thoughts on “error hibernate failed to lazily initialize a collection of role”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s