-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
AbstractTransactionalTestNGSpringContextTests not working as expected when an EJB with TransactionAttribute.REQUIRES_NEW is encountered [SPR-6132] #10800
Comments
Ed Randall commented Standalone TestNG/JPA/EJB test case to demonstrate this problem. |
Ian Jones commented I think I have hit this problem developing an application using spring. I have a scenario where a table is created and then updated with multiple rows. I am using EJB with Spring transactions ( I can provide a simple(ish) test case consisting of two EJBs and requiring a single datasource but I think it is a pretty good match for this issue. |
Sam Brannen commented Hi guys, Please create a self-contained project which reproduces the issue you are encountering and then add a link to that project here (in the form of a comment) once you've created it and submitted. Doing so will improve the chance of this issue getting addressed. You'll find details on how to do this in the README for the spring-framework-issues repository on GitHub. Thanks, Sam |
Ed Randall commented I already attached a project which reproduces this, way back in Sept 09. |
Sam Brannen commented Please note that I have added the pull-request-encouraged label to this issue in order to denote that contributions from the community would be very welcome, both in the form of an up-to-date reproduction of the issue in GitHub against Spring Framework 3.2.x as well as a pull request containing a solution to the issue. Regards, Sam |
Sam Brannen commented Hi Ed, I fully understand your frustration; however, both this issue and #10792 have only received two votes from the community. Thus, with the limited amount of time that I have to devote to Spring, having GitHub projects that I can simply check out and run would greatly increase the chance that I can address such issues. Otherwise I have to devote my time to issues with higher priority. Regards, Sam |
Xavier Detant commented Added a pull request on github : spring-attic/spring-framework-issues#55 |
Sam Brannen commented Resolving this issue as "Works as Designed". See the explanation provided in the comments for GitHub commit c0eafa9:
|
Sam Brannen commented Here is the detailed log output mentioned in the above comments. Before Suite Configuration
After Suite Configuration
|
Sam Brannen commented Further information on method invocation ordering can also be found in the official TestNG Manual. Here is an excerpt from section 5.7.1 - Dependencies with annotations:
As mentioned in the GitHub commit comments, grouping dependent methods by instance can also be achieved directly within the code by specifying a suite name at the class level. For example:
|
Ed Randall opened SPR-6132 and commented
When an
@Test
method executes an EJB annotated with@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
, it seems that the test transaction is consumed when theREQUIRES_NEW
transaction completes. Subsequent transaction behavior then becomes unexpected.Affects: 3.0.5
Reference URL: http://forum.springsource.org/showthread.php?p=261074
Attachments:
Issue Links:
@DirtiesContext
Referenced from: commits 8105011, e20c927, c0eafa9
15 votes, 9 watchers
The text was updated successfully, but these errors were encountered: