working javacode for rollback. add integration test for rollback