title: JPA CascadeType.REFRESH not working?
body: <p>I am facing a strange issue with JPA CascadeType.REFRESH attribute.
  I have a simple parent-child relationship in which in parent domain object(LineEquipmentFormat) I have added the cascade attributes like below</p>
  
  <pre><code>OneToMany(cascade = { CascadeType.REFRESH, CascadeType.MERGE, CascadeType.PERSIST,
     CascadeType.REMOVE}, mappedBy = "lineEquipmentFormat")
   public List&lt;LineEquipmentFormatDivision&gt; getLineEquipmentFormatDivisions() {
    return lineEquipmentFormatDivisions;
   }
  </code></pre>
  
  <p>But when I fetch the parent LineEquipmentFormat object from DB, I do not get the list of LineEquipmentFormatDivisions.</p>
  
  <p>Error I am getting is</p>
  
  <pre><code>  17:46:34,251 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: LineEquipmentFormat.lineEquipmentFormatDivisions, no session or session was closed
      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: LineEquipmentFormat.lineEquipmentFormatDivisions, no session or session was closed
       at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380)
       at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372)
       at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365)
       at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
       at org.hibernate.collection.PersistentBag.toString(PersistentBag.java:506)
  </code></pre>
  
  <p>I am using Jboos 5.1 and Oracle 10G.</p>
  
  <p>Please provide more inputs on possible root cause of this error.</p>
  
  <p>Thanks</p>