Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity not committed when expected #7163

Closed
emerson-dev-br opened this issue Feb 12, 2020 · 6 comments
Closed

Entity not committed when expected #7163

emerson-dev-br opened this issue Feb 12, 2020 · 6 comments
Labels
kind/question Further information is requested triage/duplicate This issue or pull request already exists

Comments

@emerson-dev-br
Copy link

emerson-dev-br commented Feb 12, 2020

During the execution of a process I open two transactions:

  • One to create an object and inform that the process has started;
  • Another to change the object that was created in the first transaction, informing that the process was completed;

However, after executing the second transaction method, if I query the database the value has not yet been updated. What I expected is that after the execution of the method with the @transactional annotation is finished, the object is already committed to the database.

The reproduction of the situation is in the project:
https://github.com/emersonl91/quarkus-test

Important lines:
https://github.com/emersonl91/quarkus-tests/blob/master/code-with-quarkus/src/main/java/org/acme/MyService.java#L32

https://github.com/emersonl91/quarkus-tests/blob/master/code-with-quarkus/src/test/java/org/acme/ExampleResourceTest.java#L37


Edit 1:

  • I tested the UserTransaction and TransactionManager classes, but the same problem also occurs.
  • Added the @transaction annotation to the method that makes the calls, the whole process starts to be executed in a single transaction, which is different from what I expect.

Edit 2:

  • In the transactionTest method I added the @transactional(NOT_SUPPORTED) annotation, in the persist and update methods I added the @transactional(REQUIRES_NEW) annotation. The result did not change.

Edit 3:

  • I did a test via POSTMAN and with MSSQL database. I followed the request in the database, the entity is updated as expected, but in the application I use the command MyEntity.findAll().list().get(0) and the entity remains not updated.
@emerson-dev-br emerson-dev-br added the kind/question Further information is requested label Feb 12, 2020
@zeljkot
Copy link

zeljkot commented Feb 12, 2020

Is it similar to this: #7102?

@emerson-dev-br
Copy link
Author

@zeljkot Yes, it looks very similar to me.

@gastaldi
Copy link
Contributor

Should we close this issue as duplicate and focus on #7102? Looks like #7188 is also related

@emerson-dev-br
Copy link
Author

@gastaldi i agree

@gastaldi
Copy link
Contributor

@emersonl91 thanks! Closing as duplicate of #7102

@gastaldi gastaldi added the triage/duplicate This issue or pull request already exists label Feb 13, 2020
@zeljkot
Copy link

zeljkot commented Feb 13, 2020

Should we close this issue as duplicate and focus on #7102? Looks like #7188 is also related

@gastaldi if I understood @FroMage correctly, #7188 is a different issue, as discussed in #7102 thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Further information is requested triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants