added optimistic locking to the domain objects
tweaked db scripts for testing