Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2016-01-25 14:47:58 +0000
committerSebastian Struckmann2016-01-26 09:34:33 +0000
commit2c0b5bcc7691264e2905e0fd57aad8b0f8aaaee6 (patch)
tree0caf17ea596a88e0fbdc7ddb78e234ccfade729c
parent1e25ebb3a5ad153ae65ba574a34ea2d1d7be6e90 (diff)
downloadorg.eclipse.jubula.core-2c0b5bcc7691264e2905e0fd57aad8b0f8aaaee6.tar.gz
org.eclipse.jubula.core-2c0b5bcc7691264e2905e0fd57aad8b0f8aaaee6.tar.xz
org.eclipse.jubula.core-2c0b5bcc7691264e2905e0fd57aad8b0f8aaaee6.zip
Non-sprint task - fix for slow delete and export of projects
see http://bugzilla.bredex.de/1757 Change-Id: I0ac72105e19bacbf31428d01383ec97867d951ff
-rw-r--r--org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/businessprocess/FileStorageBP.java2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java23
2 files changed, 24 insertions, 1 deletions
diff --git a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/businessprocess/FileStorageBP.java b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/businessprocess/FileStorageBP.java
index e20feb2ec..f2bce0107 100644
--- a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/businessprocess/FileStorageBP.java
+++ b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/businessprocess/FileStorageBP.java
@@ -1407,7 +1407,7 @@ public class FileStorageBP {
throw new InterruptedException();
}
IProjectPO projectToExport =
- ProjectPM.loadProjectById(
+ ProjectPM.loadProjectByIdAndPreLoad(
proj.getId(), exportSession);
String projectFileName = projectToExport.getDisplayName() + ".xml"; //$NON-NLS-1$
final String exportFileName;
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
index ca65c47d8..1df7eb84d 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
@@ -1491,6 +1491,7 @@ public class ProjectPM extends PersistenceManager
+ StringConstants.DOT,
MessageIDs.E_DELETED_OBJECT);
}
+ preloadData(deleteSess, proj);
persistor.lockPO(deleteSess, p);
deleteProjectIndependentDBObjects(deleteSess, p);
@@ -1866,6 +1867,28 @@ public class ProjectPM extends PersistenceManager
throw new JBException(e.getMessage(),
MessageIDs.E_PERSISTENCE_LOAD_FAILED);
}
+
+ }
+
+ /**
+ * this methods is also pre-loading most of the project data
+ * @return The project for the given (database) ID
+ * @param projectId
+ * (database) ID of the project to load
+ * @param session
+ * The session to use for loading. The returned project will be
+ * attached to this session. It is the responsibility of the
+ * caller to close the session.
+ * @throws JBException
+ * if the session cannot be loaded.
+ */
+ public static synchronized IProjectPO loadProjectByIdAndPreLoad(
+ Long projectId, EntityManager session) throws JBException {
+ IProjectPO project = loadProjectById(projectId, session);
+ if (project != null) {
+ preloadData(session, project);
+ }
+ return project;
}
/**

Back to the top