rspec/rules/S3368/java/rule.adoc

57 lines
1.3 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
According to Hibernate's documentation:
____
Hibernate's own connection pooling algorithm is, ... quite rudimentary. It is intended to help you get started and is _not intended for use in a production system_, or even for performance testing. You should use a third party pool for best performance and stability.
____
This rule raises an issue when a ``++hibernate.connection.pool_size++`` value is found in a _hibernate.cfg.xml_ or _hibernate.properties_ file.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,java]
2021-04-28 16:49:39 +02:00
----
<hibernate-configuration>
<session-factory>
<!-- ... -->
<property name="connection.pool_size">10</property> <!-- Noncompliant -->
</session-factory>
</hibernate-configuration>
----
or
2022-02-04 17:28:24 +01:00
[source,java]
2021-04-28 16:49:39 +02:00
----
// ...
hibernate.connection.pool_size=10 // Noncompliant
----
== Resources
2021-04-28 16:49:39 +02:00
* https://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html/session-configuration.html#configuration-hibernatejdbc[Hibernate, Session Configuration] - JDBC Connections
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Configure a third-party connection pool.
=== Highlighting
primary:
* property name and value for xml
* whole line for property
endif::env-github,rspecator-view[]