The Castor query does not explicitly define a query mode.
By default Castor executes queries in shared mode. Since shared mode allows both read and write access, it is unclear what kind of operation the query is intended for. If the object is going to be used in a read-only context, shared access adds unnecessary performance overhead.
Example 1: The following example does not specify a query mode.
results = query.execute(); //missing query mode
[1] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3500 CAT II
[2] ExoLab Group Castor JDO - Best practice
[3] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 265
[4] ExoLab Group, Intalio Inc., and Contributors Database (Castor JavaDoc)
[5] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 7.1.1
[6] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 7.1.1