Something seems to have gone amiss in pamac-manager since the 2019-07-03 update, where AUR packages are concerned.
Selecting a package to build an update for, it goes through downloading and building the package, but when it gets to the point of trying to install it, it fails with a message that it can't lock the database.
I've checked that /var/lib/pacman/db.lck doesn't exist before starting the process, but it has been created by the time the error message appears. So my guess is that it's creating the lockfile during the process but then checking for it again before installing the bundle that's been built.
Interestingly (and usefully) it is sometimes possible to upgrade a package by first deleting it then installing it from scratch. Though this could be problematic if other packages depend on it, as they would get removed and need to be reinstalled afterwards.
However, this doesn't seem to work for every package. I've just attempted it with android-studio and this also fails - perhaps because of the amount of time it takes to download/build/compress? I'm guessing this is also something to do with when the lockfile gets created.
Extract from pamac-manager output for failing android-studio install:
-> Found android-studio.desktop ==> Validating source files with sha256sums... android-studio-ide-183.5692245-linux.tar.gz ... Passed android-studio.desktop ... Passed ==> Removing existing $srcdir/ directory... ==> Extracting sources... -> Extracting android-studio-ide-183.5692245-linux.tar.gz with bsdtar ==> Entering fakeroot environment... ==> Starting package()... ==> Tidying install... -> Removing libtool files... -> Purging unwanted files... -> Removing static library files... -> Compressing man and info pages... ==> Checking for packaging issues... ==> Creating package "android-studio"... -> Generating .PKGINFO file... -> Generating .BUILDINFO file... -> Generating .MTREE file... -> Compressing package... ==> Leaving fakeroot environment. ==> Finished making: android-studio 22.214.171.124-1 (Sat 20 Jul 2019 15:01:51 BST) ==> Cleaning up... Failed to init transaction: unable to lock database