JPA, Spring and ObjectDB not updating?

CascadeType. PERSIST cascades the persistens of a new object but you load a player from the database and attach the player to your team. If you want to cascade that you have to add the CascadeType.

MERGE cascade = {CascadeType. PERSIST, CascadeType. MERGE} You may have a look at CascadeType.ALL.

You are right, I should have used CascadeType.ALL. I have just changed that, but nothing happened. In addition, I have found out that there is some more global problem, because NO CHANGES at all can be done to the persisted entities.

Even the simplest t. SetName("new name") does not work. It changes the name within the object on the page, but does not persist it to the database.

I know it is difficult to give advice without having the entire code to look at, but if anybody has a clue what might cause that, I can provide any information, any code, I just need to sort it out. Thank you – Pietro Falconi Oct 13 at 8:07 I've appended it to the question above. Thanks – Pietro Falconi Oct 13 at 8:28 Try to annotate your addPlayer controller action with @Transactional.

– Peter Oct 13 at 8:29 YES! That did the trick. I thought it would be something as simple as that :-).

I had the @Transactional annotation on the dao's persist() method, even tried to put it on the whole dao class, but didn't put it to the method in the controller... Thank you very much, you saved hours of my time. – Pietro Falconi Oct 13 at 8:36.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions