I am new to Spring Transaction. Something that I found really odd, probably I did understand this properly.
I wanted to have a transactional around method level and
With Spring 4 it's possible to Self autowired
@Service
@Transactional
public class UserServiceImpl implements UserService{
@Autowired
private UserRepository repository;
@Autowired
private UserService userService;
@Override
public void update(int id){
repository.findOne(id).setName("ffffd");
}
@Override
public void save(Users user) {
repository.save(user);
userService.update(1);
}
}