Is there a way to make the following code atomic (transactional)?
Hi,
Is there a way to make code similar to what follows transactional:
UserManager userManager = ...; // org.apache.jackrabbit.api.security.user.UserManager userManager.createUser(...); userManager.createGroup(...); updateGroupService.updateGroup(...) // org.apache.sling.jackrabbit.usermanager.UpdateGroup AccessControlUtil.replaceAccessControlEntry(...) JcrResourceUtil.createPath(...) JcrUtil.copy(...)
Basically:
- We create a user,
- A group,
- Assign the user to the group,
- Add permissions to the group,
- Create a folder (e.g. /content/foo/bar/baz)
- Copy some content from some folder in JCR to /content/foo/bar/baz
At the moment one or more of ceateUser, createGroup, updateGroup, replaceAccessControlEntry commit their changes even before explicitly calling save() on the current request's session.