TransactionManager transact = broker.getBrokerPool().getTransactionManager();
TransactionManager transact = pool.getTransactionManager();
	public void chown(User u, String group) throws XMLDBException {		org.exist.security.SecurityManager manager = pool.getSecurityManager();		if (!manager.hasUser(u.getName()))			throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, "Unknown user");		if (!manager.hasAdminPrivileges(user))			throw new XMLDBException(				ErrorCodes.PERMISSION_DENIED,				"need admin privileges for chown");		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);			coll.getPermissions().setOwner(u);			coll.getPermissions().setGroup(group);			broker.saveCollection(transaction, coll);            transact.commit(transaction);			broker.flush();			//broker.sync();		} 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);		}	}