<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=simonwg" rel="nofollow">Simon Wong</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9479?redirect=false" rel="nofollow">SPR-9479</a></strong> and commented</p>
<p dir="auto">The Spring reference didn't mention that I MUST use <code class="notranslate">@Configuration</code> for the configuration class being imported. And I found that the bean could be created normally most of the time.</p>
<p dir="auto">The case I found that if <code class="notranslate">@Configuration</code> is missing, transaction is not behave normally in some cases.</p>
<p dir="auto">I have setup a simple program to illustrate this. Please refer to "readme.txt" for the running procedures. From the log, I have checked that the transaction commit command has been issued, but the end result is the value is not committed.</p>
<p dir="auto">In the example, I have already used SingleConnectionDataSource, to avoid multiple database connection issue.</p>
<p dir="auto">I have also tried to move the <code class="notranslate">@EnableTransactionManagement</code> and transactionManager() to other Spring Java Config class (no matter with/without <code class="notranslate">@Configuration</code>), but the problem still occurs.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/19822/TestSpring31Transaction.zip" rel="nofollow">TestSpring31Transaction.zip</a> (<em>8.20 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398116814" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13690" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13690/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13690">#13690</a> spring-test allows you to reference configuration classes that aren't annotated with <code class="notranslate">@Configuration</code> (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=kdonald" rel="nofollow">Keith Donald</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9051?redirect=false" rel="nofollow">SPR-9051</a></strong> and commented</p>
<p dir="auto">When a <code class="notranslate">@ContextConfiguration</code> test class references a config class missing a <code class="notranslate">@Configuration</code> annotation, <code class="notranslate">@Bean</code> dependencies are wired successfully but the bean lifecycle is not applied (no init methods are invoked, for example). Adding the missing <code class="notranslate">@Configuration</code> annotation solves the problem, however the problem and solution isn't obvious since wiring/injection appeared to work.</p>
<p dir="auto">It would be better if an integration test failed-fast if you reference a config class with no <code class="notranslate">@Configuration</code> annotation.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 GA</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398151012" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14114" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14114/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14114">#14114</a> Missing <code class="notranslate">@Configuration</code> annotation will cause transaction not working (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398150646" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14061" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14061/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14061">#14061</a> Document <code class="notranslate">@Bean</code> 'lite' mode and annotated classes in the reference manual</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398157839" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/15002" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/15002/hovercard" href="https://github.com/spring-projects/spring-framework/issues/15002">#15002</a> Log warning when using inner-bean referenced without <code class="notranslate">@Configuration</code></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398161996" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/15599" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/15599/hovercard" href="https://github.com/spring-projects/spring-framework/issues/15599">#15599</a> Throw exception when <code class="notranslate">@ContextConfiguration</code>#classes are not annotated with <code class="notranslate">@Configuration</code></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398150475" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14037" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14037/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14037">#14037</a> Improve documentation for <code class="notranslate">@Bean</code> 'lite' mode and annotated class support in the TestContext Framework (<em><strong>"is superseded by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/500a4dd99579b00027918abda7d4d74f2a65b3a9/hovercard" href="https://github.com/spring-projects/spring-framework/commit/500a4dd99579b00027918abda7d4d74f2a65b3a9"><tt>500a4dd</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/2017b24867c6b009cad316960a84a7f55bec58c5/hovercard" href="https://github.com/spring-projects/spring-framework/commit/2017b24867c6b009cad316960a84a7f55bec58c5"><tt>2017b24</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/1cec0f9c6575edb9f81ef39a7019b5d3edc0d656/hovercard" href="https://github.com/spring-projects/spring-framework/commit/1cec0f9c6575edb9f81ef39a7019b5d3edc0d656"><tt>1cec0f9</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/78c6d70f0b3123d53708544324a8bbc734b81251/hovercard" href="https://github.com/spring-projects/spring-framework/commit/78c6d70f0b3123d53708544324a8bbc734b81251"><tt>78c6d70</tt></a></p>
<p dir="auto">0 votes, 5 watchers</p>