EmilienLF
EmilienLF

Reputation: 21

JPA EclipseLink: UPDATE Not Executed After Committing Merges

Using EclipseLink 2.6.4 with JTA and the property eclipselink.persistence-context.flush-mode=commit.

The UPDATE in the database is not done when I'm trying to commit a transaction where several merges are done on different objects (persisting is working fine). I checked the values and I was able to confirm that the new values are different from the data in database.

The transaction is started, committed, ended then restarted ... several times in the logic. The other commits work well before and after this one.

In addition, if I do the commit just after the merge, it's working fine but I would like to avoid as I would like to be able to rollback all actions if one of them is failing.

I activated the EclipseLink logs in FINEST, you will find an extract of them for the both cases:

The context and data are exactly the same between both cases.

The only way I was able to achieve an UPDATE in the DB is to add a commit immediately after each merge.

I tried to use the clear method of the EntityManager before each merge without any success.

I logged the value of the changed field all along the process and until the commit, it contains the updated value but then, once committing the update is not happening in the database and any select query done through new thread returns the old value.

Could you please help me to find a root cause?

Upvotes: 1

Views: 39

Answers (0)

Related Questions