diff --git a/accession-commons-core/src/main/java/uk/ac/ebi/ampt2d/commons/accession/core/AccessioningService.java b/accession-commons-core/src/main/java/uk/ac/ebi/ampt2d/commons/accession/core/AccessioningService.java index bca65c28..1edf58e4 100644 --- a/accession-commons-core/src/main/java/uk/ac/ebi/ampt2d/commons/accession/core/AccessioningService.java +++ b/accession-commons-core/src/main/java/uk/ac/ebi/ampt2d/commons/accession/core/AccessioningService.java @@ -43,6 +43,8 @@ public interface AccessioningService { * stored in the repository. * * @param messages List of objects to be accessioned or already accessioned + * @param applicationInstanceId The id of the application(instance) that is trying to generate the accessions. + * This id will be used by the underlying Accession generator when reserving blocks for generating accessions. * @return List of wrapper objects containing the accessioned objects and their associated accessions and hashes * @throws AccessionCouldNotBeGeneratedException when accession could not be generated */ diff --git a/accession-commons-monotonic-generator-jpa/src/main/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGenerator.java b/accession-commons-monotonic-generator-jpa/src/main/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGenerator.java index 55704ae3..9351df27 100644 --- a/accession-commons-monotonic-generator-jpa/src/main/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGenerator.java +++ b/accession-commons-monotonic-generator-jpa/src/main/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGenerator.java @@ -123,6 +123,7 @@ public synchronized long[] generateAccessions(int numAccessionsToGenerate, Strin * Ensures that the available ranges queue hold @param totalAccessionsToGenerate or more elements * * @param totalAccessionsToGenerate + * @param applicationInstanceId - The id of the application(instance) that is trying to reserve the block */ private synchronized void reserveNewBlocksUntilSizeIs(int totalAccessionsToGenerate, String applicationInstanceId) { while (!blockManager.hasAvailableAccessions(totalAccessionsToGenerate)) {