OpenJPA
  1. OpenJPA
  2. OPENJPA-1895

Minor reflection performance improvement.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: performance
    • Labels:
      None

      Description

      With this JIRA I'm going to call .setAccessable(true) on a number of the Reflection objects in the code base. This will be a very minor performance improvement.

        Activity

        Hide
        Rick Curtis added a comment -

        Committed revision 1037873 to trunk.

        Show
        Rick Curtis added a comment - Committed revision 1037873 to trunk.
        Hide
        Albert Lee added a comment -

        Getting the following Java 2 security exception after the setAccessibility() calls are introduced:

        Caused by: java.security.AccessControlException: Access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
        at java.security.AccessController.checkPermission(AccessController.java:108)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
        at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)
        at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:118)
        at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:49)
        ... 45 more

        at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:51)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:205)
        at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:212)
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)
        ......
        Caused by: java.lang.RuntimeException: There were errors initializing your configuration: java.lang.ExceptionInInitializerError
        at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:51)
        at java.lang.J9VMInternals.initializeImpl(Native Method)

        Need to enclose with doPriv, e.g.

        AccessController.doPrivileged(J2DoPrivHelper.setAccessibleAction(ao, true)):

        Show
        Albert Lee added a comment - Getting the following Java 2 security exception after the setAccessibility() calls are introduced: Caused by: java.security.AccessControlException: Access denied (java.lang.reflect.ReflectPermission suppressAccessChecks) at java.security.AccessController.checkPermission(AccessController.java:108) at java.lang.SecurityManager.checkPermission(SecurityManager.java:544) at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212) at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:118) at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:49) ... 45 more at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:51) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:205) at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:212) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733) ...... Caused by: java.lang.RuntimeException: There were errors initializing your configuration: java.lang.ExceptionInInitializerError at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.(ConfiguringConnectionDecorator.java:51) at java.lang.J9VMInternals.initializeImpl(Native Method) Need to enclose with doPriv, e.g. AccessController.doPrivileged(J2DoPrivHelper.setAccessibleAction(ao, true)):

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Rick Curtis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development