-
Notifications
You must be signed in to change notification settings - Fork 69
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
Extension keeps managed entities when calling @EJB #28
Comments
How does the Reader look like from the transaction perspective? Does it simply join if transaction exists? If so that is the case. It's becuase of the first level cache, which is evicted as soon as the transaction has ended. By convention persistence tests are wrapped in transaction. You can change it by settings @transactional(DISABLED). However it got me thinking if that should be the case when the only thing you need it applying some scripts... need to re-think it. Thanks for sharing the use case. If I may suggest something for the future - please use jboss forum for such questions. I guess it's better suited for "support" :) |
Actually this looks like an issue to me instead of a regular question, that is why I posted here. In my point of view the expectation of a user is the test content to behave exactly as if arquillian persistence API is not being used. In this case I want to test if a given Can this be considered a bug? The tests are behaving in a unexpected way if and only if I enable the arquillian persistence API.
I suppose this use case conflicts with the actual convention. And the solution would require new code to be added. Thanks. |
With regards to wrapping in the transaction, if you seed something in the database it's more common that your test needs to run in the transaction as you interact with the persistence layer (and you probably assume that caller of your EJB runs in transaction already). But maybe this should be narrowed only for per-test-method usage... I need to think about it. Thx for some food for thoughts. However I don't see it as a bug to be honest (at least not yet ;). Anyways - I will chew it over and go back to you soon. For the time being please disable transactions (can be done on the class level to not repeat yourself for each and every test). |
Ok then, for the time being I will disable the transactions when such case is required. |
Are you still facing the problem? Otherwise I would like to close this issue if the new version is not having mentioned problem |
Unfortunately I am not able to check if the problem still exists because it's been a long time since it was reported and I am not even working with Java anymore. In the end it is up to you to decide if there are enough informations that justify this issue to stay open or not based in the potential benefit for the extension :) |
Fair enough. Will try to investigate :) |
I am not familiarized with the specifics of the J2EE implementation. But the test below fails when used in conjunction with this arquillian extension (part of the code apparently non relevant is ommited):
I suppose
secondProblem.getTitle()
should be"test"
but it is actually receiving"newtest"
. It only happens if I use the following annotations in the class level:That eventually enables the extension. When I remove those the test is completed successfully.
The text was updated successfully, but these errors were encountered: