Both of these steps run groovy scripts that follow the following general format:
groovy:
try
{
com.pmease.quickbuild.persistence.SessionManager.openSession();
//stuff
}
finally
{
com.pmease.quickbuild.persistence.SessionManager.closeSession();
}
The problem I'm running into is that step A can run just fine, but step B will error out with:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.pmease.quickbuild.model.Build.promotedTo, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)....
The only way I've gotten step B to run successfully after step A is to restart my QB server. After that the config will run successfully once but after that, it will fail on step B with the error above. Step B is using the "build.getPromotedTo" that was mentioned in a previous thread. I have to use system.getBuildManager() in both step A and B, so I have to use open/close session, and A and B can't be combined into one step. Any help resolving this will be much appreciated. Thank you!