People editing documents at the same time can be a big pain for the developer resulting in unwanted problems in an deployed application. To handle this problem I created a managed bean DocLock to handle the problem. The managed bean stores the username and an id each time the users edits a document. If another user tries to edit the document, you can block the user from entering edit mode.
To implement the managed bean in your own database is very simple, Copy the java class and add the managed bean setup into faces-config.xml ( check the supplied readme file)
The project is released on Openntf –> Link
Enjoy getting less document conflicts.