[jboss-user] [jBPM] - Problem with hibernate entity and variable

Jaber C. Mourad do-not-reply at jboss.com
Fri Jan 21 08:43:05 EST 2011


Jaber C. Mourad [http://community.jboss.org/people/newbeewan] created the discussion

"Problem with hibernate entity and variable"

To view the discussion, visit: http://community.jboss.org/message/582358#582358

--------------------------------------------------------------
Hi,

I encoutered a trouble with hibernate entity stored into a process variable in jbpm 4.4...

I've got every time a lazy loading error for any property of a very simple entity :

@Entity
@Table(name = "DAY_OFF_TYPE")
public class DayOffType extends AbstractEntity {
 
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "ID")
      private Long id;
      @Column(name = "KEY_LABEL", nullable = false)
      private String keyLabel;
 
      @Column(name = "PDF_TYPE", nullable = true)
      private String pdfType;
 
      @Column(name= "AVAILABILITY")
      @Enumerated(EnumType.STRING)
      private TypeOfAvailability availability;
 
      public void setAvailability(TypeOfAvailability availability) {
            this.availability = availability;
      }
 
      public TypeOfAvailability getAvailability() {
            return availability;
      }
 
      public Long getId() {
            return id;
      }
 
      public void setId(Long id) {
            this.id = id;
      }
 
      public String getKeyLabel() {
            return keyLabel;
      }
 
      public void setKeyLabel(String keyLabel) {
            this.keyLabel = keyLabel;
      }
 
      public String getPdfType() {
            return pdfType;
      }
 
      public void setPdfType(String pdfType) {
            this.pdfType = pdfType;
      }
 
}


I lod that entity for a DAO, put it in a process variable, and trying to acces to it during an other task, and I've got an Exception when I'm trying to access to any property :

[ERROR] org.hibernate.LazyInitializationException 42  - could not initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
        at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
        at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
        at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
        at mypackage.data.DayOffType_$$_javassist_13.getId(DayOffType_$$_javassist_13.java)
        at mypackage.process.vacancy.VacancyProcessTest.testProcess(VacancyProcessTest.java:100)


Any idea to solve that issue ?

Regards
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/582358#582358]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110121/92677ad4/attachment.html 


More information about the jboss-user mailing list