Program: 160581
Project: 160581
Buggy source:
protected void executeAction(BimDatabaseAction<? extends IfcModelInterface> action,DownloadParameters downloadParameters,DatabaseSession session,boolean commit) throws BimserverDatabaseException, UserException, NoSerializerFoundException, ServerException {
  try {
    if (action == null) {
      checkoutResult=new SCheckoutResult();
      checkoutResult.setFile(new DataHandler(getBimServer().getDiskCacheManager().get(downloadParameters)));
    }
 else {
      Revision revision=session.get(StorePackage.eINSTANCE.getRevision(),downloadParameters.getRoid(),Query.getDefault());
      revision.getProject().getGeoTag().load();
      IfcModelInterface ifcModel=session.executeAndCommitAction(action);
      DatabaseSession newSession=getBimServer().getDatabase().createSession();
      RenderEnginePlugin renderEnginePlugin=null;
      try {
        SerializerPluginConfiguration serializerPluginConfiguration=newSession.get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(),downloadParameters.getSerializerOid(),Query.getDefault());
        if (serializerPluginConfiguration != null) {
          RenderEnginePluginConfiguration renderEngine=serializerPluginConfiguration.getRenderEngine();
          if (renderEngine != null) {
            renderEnginePlugin=(RenderEnginePlugin)getBimServer().getPluginManager().getRenderEngine(renderEngine.getPluginDescriptor().getPluginClassName(),true);
          }
        }
      }
 catch (      BimserverDatabaseException e) {
        LOGGER.error("String_Node_Str",e);
      }
 finally {
        newSession.close();
      }
      checkoutResult=convertModelToCheckoutResult(revision.getProject(),getUserName(),ifcModel,renderEnginePlugin,downloadParameters);
    }
  }
  finally {
    done();
  }
}

Fixed version (ground truth):
protected void executeAction(BimDatabaseAction<? extends IfcModelInterface> action,DownloadParameters downloadParameters,DatabaseSession session,boolean commit) throws BimserverDatabaseException, UserException, NoSerializerFoundException, ServerException {
  try {
    if (action == null) {
      checkoutResult=new SCheckoutResult();
      checkoutResult.setFile(new DataHandler(getBimServer().getDiskCacheManager().get(downloadParameters)));
    }
 else {
      Revision revision=session.get(StorePackage.eINSTANCE.getRevision(),downloadParameters.getRoid(),Query.getDefault());
      revision.getProject().getGeoTag().load();
      IfcModelInterface ifcModel=session.executeAndCommitAction(action);
      DatabaseSession newSession=getBimServer().getDatabase().createSession();
      RenderEnginePlugin renderEnginePlugin=null;
      try {
        SerializerPluginConfiguration serializerPluginConfiguration=newSession.get(StorePackage.eINSTANCE.getSerializerPluginConfiguration(),downloadParameters.getSerializerOid(),Query.getDefault());
        if (serializerPluginConfiguration != null) {
          RenderEnginePluginConfiguration renderEngine=serializerPluginConfiguration.getRenderEngine();
          if (renderEngine != null) {
            renderEnginePlugin=getBimServer().getPluginManager().getRenderEngine(renderEngine.getPluginDescriptor().getPluginClassName(),true);
          }
        }
      }
 catch (      BimserverDatabaseException e) {
        LOGGER.error("String_Node_Str",e);
      }
 finally {
        newSession.close();
      }
      checkoutResult=convertModelToCheckoutResult(revision.getProject(),getUserName(),ifcModel,renderEnginePlugin,downloadParameters);
    }
  }
  finally {
    done();
  }
}