この規則により、WEB-INF/web.xml ファイル内に見つかり、res-sharing-scope エレメントが欠落している resource-ref エレメントにフラグを立てます。 Apache Tomcat サーバーの場合、デフォルトのリソース共有有効範囲は Shareable です。 Java EE では、リソース共有有効範囲はオプション属性として定義されます。 ソース・スキャナーで、この規則のクイック・フィックスが使用可能です。WebSphere traditional および Liberty で Tomcat の場合と同じ共有可能有効範囲を設定するには、クイック・フィックスを使用できます。
クイック・フィックスは、res-sharing-scope エレメントがまだ設定されていなければこれを追加し、接続を Shareable として定義します。
以下は、フラグが立てられるリソース参照の例です。|
<resource-ref> <description> Example Database</description> <res-ref-name>jdbc/exampleDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> |
|
<resource-ref> <description> Example Database</description> <res-ref-name>jdbc/exampleDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> |
WebSphere Application Server でのリソース接続の共有について詳しくは、共有不可能接続および共有可能接続を参照してください。