rspec/rules/S3823/java/rule.adoc

14 lines
489 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The use of a "RESOURCE_LOCAL" ``++persistence-unit++`` makes you responsible for your own entity management, which involves a lot of extra boilerplate code to get right. Instead, set this to "JPA" in a JavaSE environment or omit it altogether in a JavaEE environment, where "JPA" is the default.
== Noncompliant Code Example
----
<persistence-unit transaction-type="RESOURCE_LOCAL"> <!-- Noncompliant -->
----
== Compliant Solution
----
<persistence-unit transaction-type="JTA">
----