TransactionManager transact = broker.getBrokerPool().getTransactionManager();
TransactionManager transact = pool.getTransactionManager();
	public void chmod(String modeStr) throws XMLDBException {		org.exist.security.SecurityManager manager = pool.getSecurityManager();		org.exist.collections.Collection coll = null;		DBBroker broker = null;        TransactionManager transact = broker.getBrokerPool().getTransactionManager();        Txn transaction = transact.beginTransaction();		try {			broker = pool.get(user);			coll = broker.openCollection(collection.getPath(), Lock.WRITE_LOCK);			if(coll == null)				throw new XMLDBException(ErrorCodes.INVALID_COLLECTION, "Collection " + collection.getPath() + 						" not found");			if (!collection.checkOwner(coll, user) && !manager.hasAdminPrivileges(user)) {                transact.abort(transaction);				throw new XMLDBException(					ErrorCodes.PERMISSION_DENIED,					"you are not the owner of this collection");            }			coll.setPermissions(modeStr);			broker.saveCollection(transaction, coll);            transact.commit(transaction);			broker.flush();		} catch (SyntaxException e) {            transact.abort(transaction);			throw new XMLDBException(				ErrorCodes.VENDOR_ERROR,				e.getMessage(),				e);		} catch (LockException e) {            transact.abort(transaction);			throw new XMLDBException(				ErrorCodes.VENDOR_ERROR,				"Failed to acquire lock on collections.dbx",				e);		} catch (EXistException e) {            transact.abort(transaction);			throw new XMLDBException(				ErrorCodes.VENDOR_ERROR,				e.getMessage(),				e);		} catch (PermissionDeniedException e) {            transact.abort(transaction);			throw new XMLDBException(				ErrorCodes.PERMISSION_DENIED,				e.getMessage(),				e);		} finally {			if(coll != null)				coll.release();			pool.release(broker);		}	}