could you please describe your application configuration? Best would be to have sort of reproducer of this problem as it looks like some entity manger is cached somewhere and thus causing optimistic locking/stale object exception. In general the entity manager should be cleared at transaction completion but maybe that somehow does not work in spring - depending on transaction management. See here.
HTH