`
@Service
@Transactional
Public class UserService
public void saveUser()
    User userEntity = new User();
    userEntity.setName("test");
    User userDataFromDB =            userRepository.save(userEntity);
    LOG.info("user Id= " +userDataFromDB.getId());
//entity code below
@Id 
@GeneratedValue(strategy = 
GenerationType.IDENTITY)
@Column(name="ID")
private int id;
@Column(name="NAME")
private string name;`
not able to get the saved Id of user only after using transactional annotation else getting the id after removing transactional annotation . Any help would be appreciable.
 
    