From 06f8dc4c96e94d4c6835d6722282759dde881acd Mon Sep 17 00:00:00 2001 From: "Richard G. Curtis" Date: Mon, 22 Nov 2010 20:44:49 +0000 Subject: [PATCH] OPENJPA-1895: Minor performance improvement. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1037873 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java | 4 ++++ .../openjpa/lib/jdbc/ConfiguringConnectionDecorator.java | 1 + .../openjpa/lib/jdbc/DelegatingPreparedStatement.java | 1 + .../apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java index 893da73cf..0614c9c6e 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java @@ -125,12 +125,16 @@ public class JDBCStoreManager try { clientConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(ClientConnection.class, Connection.class); + clientConnectionImpl.setAccessible(true); refCountConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(RefCountConnection.class, JDBCStoreManager.class, Connection.class); + refCountConnectionImpl.setAccessible(true); cancelStatementImpl = ConcreteClassGenerator.getConcreteConstructor(CancelStatement.class, JDBCStoreManager.class, Statement.class, Connection.class); + cancelStatementImpl.setAccessible(true); cancelPreparedStatementImpl = ConcreteClassGenerator.getConcreteConstructor(CancelPreparedStatement.class, JDBCStoreManager.class, PreparedStatement.class, Connection.class); + cancelPreparedStatementImpl.setAccessible(true); } catch (Exception e) { throw new ExceptionInInitializerError(e); } diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java index 0274f653d..dcd710813 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/ConfiguringConnectionDecorator.java @@ -46,6 +46,7 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator { try { configuringConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(ConfiguringConnection.class, ConfiguringConnectionDecorator.class, Connection.class); + configuringConnectionImpl.setAccessible(true); } catch (Exception e) { throw new ExceptionInInitializerError(e); } diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingPreparedStatement.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingPreparedStatement.java index 0bed709a3..0a5e042e2 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingPreparedStatement.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingPreparedStatement.java @@ -61,6 +61,7 @@ public abstract class DelegatingPreparedStatement try { concreteImpl = ConcreteClassGenerator.getConcreteConstructor(DelegatingPreparedStatement.class, PreparedStatement.class, Connection.class); + concreteImpl.setAccessible(true); } catch (Exception e) { throw new ExceptionInInitializerError(e); } diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java index 53b4915af..c056ecc8a 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/LoggingConnectionDecorator.java @@ -99,21 +99,27 @@ public class LoggingConnectionDecorator implements ConnectionDecorator { try { loggingConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(LoggingConnection.class, LoggingConnectionDecorator.class, Connection.class); + loggingConnectionImpl.setAccessible(true); loggingResultSetImpl = ConcreteClassGenerator.getConcreteConstructor( LoggingConnection.LoggingResultSet.class, LoggingConnection.class, ResultSet.class, Statement.class); + loggingResultSetImpl.setAccessible(true); loggingStatementImpl = ConcreteClassGenerator.getConcreteConstructor( LoggingConnection.LoggingStatement.class, LoggingConnection.class, Statement.class); + loggingStatementImpl.setAccessible(true); loggingPreparedStatementImpl = ConcreteClassGenerator.getConcreteConstructor( LoggingConnection.LoggingPreparedStatement.class, LoggingConnection.class, PreparedStatement.class, String.class); + loggingPreparedStatementImpl.setAccessible(true); loggingCallableStatementImpl = ConcreteClassGenerator.getConcreteConstructor( LoggingConnection.LoggingCallableStatement.class, LoggingConnection.class, CallableStatement.class, String.class); + loggingCallableStatementImpl.setAccessible(true); loggingDatabaseMetaDataImpl = ConcreteClassGenerator.getConcreteConstructor( LoggingConnection.LoggingDatabaseMetaData.class, LoggingConnection.class, DatabaseMetaData.class); + loggingDatabaseMetaDataImpl.setAccessible(true); } catch (Exception e) { throw new ExceptionInInitializerError(e); }