
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
34 lines
935 B
Plaintext
34 lines
935 B
Plaintext
== Why is this an issue?
|
|
|
|
By default, Hibernate ``++session++`` flushing is set to ``++FlushMode.AUTO++``, and is called from ``++Transaction.commit++``, ``++Session.flush++`` and before some queries are executed. Setting it to ``++FlushMode.COMMIT++``, ``++FlushMode.NEVER++``, or ``++FlushMode.MANUAL++`` could mean that parts of your application get stale data, so you should be sure of what you're doing before you use any of these modes.
|
|
|
|
|
|
This rule raises an issue when flush mode is explicitly set to any of these modes.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,java]
|
|
----
|
|
Session session = sessionFactory.openSession();
|
|
session.setFlushMode(FlushMode.NEVER); // Noncompliant
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Make sure you really don't want "AUTO" flushing.
|
|
|
|
|
|
=== Highlighting
|
|
|
|
* primary: the FlushMode
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|