You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2019/01/06 22:45:03 UTC

[openjpa] branch master updated (d25ed12 -> bb6bad0)

This is an automated email from the ASF dual-hosted git repository.

struberg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git.


    from d25ed12  OPENJPA-2753 improve postgresql docker setup
     new a53744a  fix missing space in readme
     new bb6bad0  OPENJPA-2753 add a profile for Oracle as Docker image

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.adoc                                        |   2 +-
 .../org/apache/openjpa/jdbc/sql/DBDictionary.java  |   6 +-
 .../openjpa/conf/OpenJPAConfigurationImpl.java     |   8 +-
 .../lib/jdbc/DelegatingDatabaseMetaData.java       |   6 +-
 pom.xml                                            | 106 ++++++++++++++++++++-
 src/test/sql/oracle-docker/init.sql                |  28 ++++++
 6 files changed, 144 insertions(+), 12 deletions(-)
 create mode 100644 src/test/sql/oracle-docker/init.sql


[openjpa] 02/02: OPENJPA-2753 add a profile for Oracle as Docker image

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit bb6bad070217721424e51edf1b4e5725e3a8e489
Author: Mark Struberg <st...@apache.org>
AuthorDate: Sun Jan 6 23:43:41 2019 +0100

    OPENJPA-2753 add a profile for Oracle as Docker image
    
    -Ptest-oracle-docker
    as new profile to start Oracle 11_XE
---
 .../org/apache/openjpa/jdbc/sql/DBDictionary.java  |   6 +-
 .../openjpa/conf/OpenJPAConfigurationImpl.java     |   8 +-
 .../lib/jdbc/DelegatingDatabaseMetaData.java       |   6 +-
 pom.xml                                            | 106 ++++++++++++++++++++-
 src/test/sql/oracle-docker/init.sql                |  28 ++++++
 5 files changed, 143 insertions(+), 11 deletions(-)

diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
index 888e35a..3f02899 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
@@ -550,9 +550,9 @@ public class DBDictionary
                 supportsGetGeneratedKeys =  (isJDBC3) ? metaData.supportsGetGeneratedKeys() : false;
             }
             if (log.isInfoEnabled()) {
-            	log.info(_loc.get("dict-info", new Object[] {
-            		metaData.getDatabaseProductName(), getMajorVersion(), getMinorVersion(),
-            		metaData.getDriverName(), metaData.getDriverVersion()}));
+                log.info(_loc.get("dict-info", new Object[] {
+                        metaData.getDatabaseProductName(), getMajorVersion(), getMinorVersion(),
+                        metaData.getDriverName(), metaData.getDriverVersion()}));
             }
         }
         connected = true;
diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
index d3b6765..17d9b84 100644
--- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
+++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
@@ -1849,12 +1849,12 @@ public class OpenJPAConfigurationImpl
 
     @Override
     public boolean isInitializeEagerly() {
-    	return eagerInitialization.get();
+        return eagerInitialization.get();
     }
 
     @Override
     public void setInitializeEagerly(boolean retry) {
-    	eagerInitialization.set(retry);
+        eagerInitialization.set(retry);
     }
 
     @Override
@@ -1960,8 +1960,8 @@ public class OpenJPAConfigurationImpl
         getAuditorInstance();
         cacheMarshallerPlugins.initialize();
         if (isInitializeEagerly()) {
-        	getConnectionFactory();
-        	getConnectionFactory2();
+            getConnectionFactory();
+            getConnectionFactory2();
         }
     }
 
diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java
index 17b0621..181344e 100644
--- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java
+++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/jdbc/DelegatingDatabaseMetaData.java
@@ -1004,12 +1004,12 @@ public class DelegatingDatabaseMetaData implements DatabaseMetaData {
 
     @Override
     public boolean generatedKeyAlwaysReturned() throws SQLException {
-    	throw new UnsupportedOperationException();
+        return _metaData.generatedKeyAlwaysReturned();
     }
 
     @Override
     public ResultSet getPseudoColumns(String catalog, String schemaPattern,
-    	String tableNamepattern, String columnNamePattern) throws SQLException {
-    	throw new UnsupportedOperationException();
+            String tableNamepattern, String columnNamePattern) throws SQLException {
+        return _metaData.getPseudoColumns(catalog, schemaPattern, tableNamepattern, columnNamePattern);
     }
 }
diff --git a/pom.xml b/pom.xml
index c80e4a0..6f29b68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1368,6 +1368,110 @@
             </repositories>
         </profile>
 
+        <!--
+            Profile for testing with Oracle DB against a Docker image
+
+            Attention: This might requiere a manual download of the Oracle JDBC driver.
+            This driver (ojdbc6.jar) can be downloaded at the Oracle homepage.
+
+            Then determine which version you got
+            $> unzip -p ojdbc6.jar META-INF/MANIFEST.MF
+            This will contain something like
+            "Implementation-Version: 11.2.0.4.0"
+            Use this version to install the JDBC driver into your local Maven repository
+            with
+            $> mvn install:file ...
+
+            By default we use a ojdbc6 version hosted at Atlassian.
+            For this to work we also need to add a repository section.
+            We only use it for the ojdbc driver though.
+        -->
+        <profile>
+            <id>test-oracle-docker</id>
+            <activation>
+                <property>
+                    <name>test-oracle-docker</name>
+                </property>
+            </activation>
+            <properties>
+                <!-- by default we use the Atlassian 3rd Party repo, which contains the dependency -->
+                <oracle.maven.repo>https://packages.atlassian.com/maven-3rdparty/</oracle.maven.repo>
+
+                <oracle.groupid>com.oracle</oracle.groupid>
+                <oracle.artifactid>ojdbc6</oracle.artifactid>
+                <oracle.version>11.2.0.4.0-atlassian-hosted</oracle.version>
+
+                <oracle.server.version>16.04</oracle.server.version>
+                <docker.external.oracle.port>1521</docker.external.oracle.port>
+
+                <connection.driver.name>oracle.jdbc.driver.OracleDriver</connection.driver.name>
+                <openjpa.oracle.database>openjpatst</openjpa.oracle.database>
+                <openjpa.oracle.username>openjpatst</openjpa.oracle.username>
+                <openjpa.oracle.password>openjpatst</openjpa.oracle.password>
+                <openjpa.oracle.SID>xe</openjpa.oracle.SID>
+                <openjpa.oracle.url>jdbc:oracle:thin:@localhost:${docker.external.oracle.port}:${openjpa.oracle.SID}</openjpa.oracle.url>
+
+                <connection.url>${openjpa.oracle.url}</connection.url>
+                <connection.username>${openjpa.oracle.username}</connection.username>
+                <connection.password>${openjpa.oracle.password}</connection.password>
+                <jdbc.DBDictionary />
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>${oracle.groupid}</groupId>
+                    <artifactId>${oracle.artifactid}</artifactId>
+                    <version>${oracle.version}</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+
+            <repositories>
+                <repository>
+                    <id>oracle.repository</id>
+                    <name>Oracle Repository</name>
+                    <url>${oracle.maven.repo}</url>
+                    <layout>default</layout>
+                    <snapshots>
+                        <enabled>false</enabled>
+                    </snapshots>
+                    <releases>
+                        <enabled>true</enabled>
+                    </releases>
+                </repository>
+            </repositories>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <configuration>
+                            <images>
+                                <image>
+                                    <name>wnameless/oracle-xe-11g:${oracle.server.version}</name>
+                                    <run>
+<!--
+                                        <env>
+                                            <ORACLE_DISABLE_ASYNCH_IO>true</ORACLE_DISABLE_ASYNCH_IO>
+                                        </env>
+-->
+                                        <volumes>
+                                            <bind>
+                                                <volume>${project.basedir}/src/test/sql/oracle-docker:/docker-entrypoint-initdb.d/</volume>
+                                            </bind>
+                                        </volumes>
+                                        <ports>
+                                            <port>${docker.external.oracle.port}:1521</port>
+                                        </ports>
+                                    </run>
+                                </image>
+                            </images>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
         <!-- Profile for testing with Oracle DB -->
         <profile>
             <!--
@@ -1751,7 +1855,7 @@
                 <plugin>
                     <groupId>io.fabric8</groupId>
                     <artifactId>docker-maven-plugin</artifactId>
-                    <version>0.27.2</version>
+                    <version>0.28.0</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
diff --git a/src/test/sql/oracle-docker/init.sql b/src/test/sql/oracle-docker/init.sql
new file mode 100644
index 0000000..8886510
--- /dev/null
+++ b/src/test/sql/oracle-docker/init.sql
@@ -0,0 +1,28 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+-- ***********************************************************
+-- Init script for creating a work user schema for running
+-- tests against our oracle Docker image.
+-- See the 'test-oracle-docker' Maven Profile
+-- ***********************************************************
+
+
+CREATE USER openjpatst IDENTIFIED BY openjpatst;
+GRANT CONNECT, RESOURCE, DBA TO openjpatst;
+GRANT CREATE SESSION GRANT ANY PRIVILEGE TO openjpatst;
+GRANT UNLIMITED TABLESPACE TO  openjpatst;
\ No newline at end of file


[openjpa] 01/02: fix missing space in readme

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit a53744a744465bd7ef480d7fb79a68ec9e9365d3
Author: Mark Struberg <st...@apache.org>
AuthorDate: Thu Jan 3 21:28:04 2019 +0100

    fix missing space in readme
---
 README.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.adoc b/README.adoc
index c83d175..d8c8643 100644
--- a/README.adoc
+++ b/README.adoc
@@ -33,7 +33,7 @@ The best way to compile Apache OpenJPA yourself is to run the build against the
 The Apache OpenJPA project also contains a setup for testing against multiple databases.
 The easiest way is to use Docker.
 We assume that Docker is installed to be used from your current user.
-The respective database imagehas to be started manually bofore starting the build.
+The respective database image has to be started manually bofore starting the build.
 The reason for not starting it as part of the build itself is to be able to look at the database content after the build did run.
 
 To start e.g. a PostgreSQL Docker image you can simply invoke the following command.