Sc dsc 698 recurse del

Possibly. It shouldn't be necessary however, as I don't see multiple threads accessing this particular Map.

Good thought though.

From: shuangzhou <notifications@github.com<mailto:notifications@github.com>>
Reply-To: nla/banjo <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Wednesday, 12 November 2014 4:52 PM
To: nla/banjo <banjo@noreply.github.com<mailto:banjo@noreply.github.com>>
Cc: Shaun Coen <scoen@nla.gov.au<mailto:scoen@nla.gov.au>>
Subject: Re: [banjo] Sc dsc 698 recurse del (#830)


In src/banjo/controllers/WorksController.java:

>
> -        if (!userAccess.hasEditAccess(work)) {
> -            throw new NoAccessException();
> +        try (AmberSession amberSession = amberDbService.get()) {
> +            Work work = amberSession.findWork(objectId);
> +            checkAccess(userAccess.hasEditAccess(work));
> +            String parentId = (work.getParent() == null) ? "" : work.getParent().getObjId();
> +            work.setCommentsInternal(work.getCommentsInternal() + "\n\nDeletion reason:" + deleteReason);
> +            Map<String, Integer> counts = amberSession.deleteWorkWithAudit(new HashMap<String, Integer>(), work);


with passed in HashMap, might be better with ConcurrentHashMap.

—
Reply to this email directly or view it on GitHub<https://github.com/nla/banjo/pull/830/files#r20202428>.