You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by al...@apache.org on 2010/10/18 19:48:30 UTC

svn commit: r1023925 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java openjpa-persistence-jdbc/pom.xml openjpa-project/src/doc/manual/supported_databases.xml

Author: allee8285
Date: Mon Oct 18 17:48:30 2010
New Revision: 1023925

URL: http://svn.apache.org/viewvc?rev=1023925&view=rev
Log:
OPENJPA-1837 - reset Oracle dictionary maxEmbedded*lobSize = -1 for jdbc driver (11.2.0.x) that can handle *lob size > 4000 characters.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
    openjpa/trunk/openjpa-persistence-jdbc/pom.xml
    openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1023925&r1=1023924&r2=1023925&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Mon Oct 18 17:48:30 2010
@@ -227,9 +227,15 @@ public class OracleDictionary
             if (metadataClassName.startsWith("oracle.")
                 || url.indexOf("jdbc:oracle:") != -1
                 || "Oracle JDBC driver".equals(driverName)) {
-                driverVendor = VENDOR_ORACLE + meta.getDriverMajorVersion()
-                    + meta.getDriverMinorVersion();
-
+                int jdbcMajor = meta.getDriverMajorVersion();
+                int jdbcMinor = meta.getDriverMinorVersion();
+                driverVendor = VENDOR_ORACLE + jdbcMajor + jdbcMinor;
+
+                int jdbcVersion = jdbcMajor * 1000 + jdbcMinor;
+                if( jdbcVersion >= 11002) {
+                    maxEmbeddedBlobSize = -1;
+                    maxEmbeddedClobSize = -1;
+                }
                 String productVersion = meta.getDatabaseProductVersion()
                     .split("Release ",0)[1].split("\\.",0)[0];
                 int release = Integer.parseInt(productVersion);

Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=1023925&r1=1023924&r2=1023925&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Mon Oct 18 17:48:30 2010
@@ -7,18 +7,18 @@
  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.   
+ under the License.
 -->
-<!-- 
-    Maven release plugin requires the project tag to be on a single line. 
+<!--
+    Maven release plugin requires the project tag to be on a single line.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
@@ -268,7 +268,7 @@
                 <connection.password>${openjpa.sybase.password}</connection.password>
             </properties>
         </profile>
-        
+
         <!-- Profile for testing with Sybase DB using the jConnect driver -->
         <profile>
             <id>test-sybase-jconnect</id>
@@ -288,7 +288,7 @@
                 <connection.password>${openjpa.sybase.password}</connection.password>
             </properties>
         </profile>
-        
+
         <!-- Profile for testing with Ingres DB -->
         <profile>
             <id>test-ingres</id>
@@ -395,14 +395,14 @@
                 <connection.password>${openjpa.custom.password}</connection.password>
             </properties>
         </profile>
-        
-        <!--  
-            The test-custom2 profile does not work very well when used with a 
-            continuous build system. As a convenience I've added profiles for 
-            some of the proprietary databases to make testing easier. 
+
+        <!--
+            The test-custom2 profile does not work very well when used with a
+            continuous build system. As a convenience I've added profiles for
+            some of the proprietary databases to make testing easier.
           -->
         <profile>
-            <!-- 
+            <!--
                 Example db2 profile. You can use this profile if you:
                 1) have the DB2 artifacts installed in a local repo and supply
                 the URL:
@@ -411,13 +411,13 @@
                 commands :
                     mvn install:install-file -Dfile=${path to db2jcc.jar} \
                                              -DgroupId=com.ibm.db2 \
-                                             -DartifactId=jcc-driver \ 
+                                             -DartifactId=jcc-driver \
                                              -Dversion=9.5 \
                                              -Dpackaging=jar
-                                         
+
                     mvn install:install-file -Dfile=${path to db2jcc_license.jar} \
                                              -DgroupId=com.ibm.db2 \
-                                             -DartifactId=jcc-license \ 
+                                             -DartifactId=jcc-license \
                                              -Dversion=9.5 \
                                              -Dpackaging=jar
 
@@ -481,7 +481,7 @@
                     </releases>
                 </repository>
             </repositories>
-        </profile>          
+        </profile>
 
         <!-- Profile for testing Apache Derby with the DB2 JCC driver -->
         <profile>
@@ -544,9 +544,9 @@
 
         <!-- Profile for testing Informix with the DB2 JCC driver -->
         <profile>
-            <!-- 
+            <!--
                 Example Informix JCC profile. You can use this profile if you:
-                1a) have the DB2 JCC artifacts installed in a local repo and 
+                1a) have the DB2 JCC artifacts installed in a local repo and
                 supply the URL:
 	            -Dids.maven.repo=http://my.local.repo
                 1b) or have a copy of the DB2 JCC driver and run the commands
@@ -617,7 +617,7 @@
 
         <!-- Profile for testing with Oracle DB -->
         <profile>
-            <!-- 
+            <!--
                 Example oracle profile. You can use this profile if you:
                 1) have the Oracle artifacts installed in a local repo and
                 supply the URL:
@@ -626,10 +626,10 @@
                 command:
                     mvn install:install-file -Dfile=${path to ojdbc.jar} \
                                              -DgroupId=com.oracle \
-                                             -DartifactId=jdbc-driver \ 
+                                             -DartifactId=jdbc-driver \
                                              -Dversion=10g \
                                              -Dpackaging=jar
-                                         
+
                 You must also set the following properties:
                     -Dopenjpa.oracle.url
                     -Dopenjpa.oracle.username
@@ -658,7 +658,7 @@
                 <oracle.maven.repo>http://not.a.real.repository</oracle.maven.repo>
                 <oracle.groupid>com.oracle</oracle.groupid>
                 <oracle.artifactid>jdbc-driver</oracle.artifactid>
-                <oracle.version>10g</oracle.version>
+                <oracle.version>11.2.0.1-jdbc6</oracle.version>
                 <connection.driver.name>oracle.jdbc.driver.OracleDriver</connection.driver.name>
                 <!--<connection.url>jdbc:oracle:thin:@localhost:1521:OPENJPA</connection.url>-->
                 <connection.url>${openjpa.oracle.url}</connection.url>
@@ -777,7 +777,7 @@
                     <execution>
                         <phase>process-test-classes</phase>
                         <configuration>
-                            <tasks>                           
+                            <tasks>
                                 <ant antfile="src/main/ant/enhancer.xml" target="enhance" inheritRefs="true">
                                     <property name="maven.test.skip" value="${maven.test.skip}" />
                                     <property name="test" value="${test}" />
@@ -801,7 +801,7 @@
                 <configuration>
                     <argLine>${surefire.jvm.args}</argLine>
                     <excludes>
-                        <!-- exclude classes that end with 'Test'; these 
+                        <!-- exclude classes that end with 'Test'; these
                              are not test cases per OpenJPA standards -->
                         <exclude>org/apache/openjpa/**/*Test.java</exclude>
 
@@ -809,7 +809,7 @@
                              are not test cases per OpenJPA standards -->
                         <exclude>org/apache/openjpa/**/*$*.class</exclude>
                         <exclude>org/apache/openjpa/**/*.*.class</exclude>
-                        
+
                         <!-- exclude "no xsd" test until a workaround is figured out (OPENJPA-513)  -->
                         <exclude>org/apache/openjpa/persistence/xml/TestPersistenceUnitWithoutXSD.java</exclude>
 
@@ -964,7 +964,7 @@
                         <exclude>org/apache/openjpa/persistence/kernel/TestPMMemory.java</exclude>
 
                         <exclude>org/apache/openjpa/persistence/meta/TestExternalValues.java</exclude>
-                        
+
                         <!-- Exclude subclassing tests   -->
                         <exclude>org/apache/openjpa/**/TestUnenhanced*.java</exclude>
 

Modified: openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml?rev=1023925&r1=1023924&r2=1023925&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml Mon Oct 18 17:48:30 2010
@@ -1139,11 +1139,11 @@ List results = query.getResultList();
                 <listitem>
                     <para> 
 The Oracle JDBC driver has significant differences between different versions. 
-It is important to use the officially supported version of the driver 
-(10.2.0.1.0), which is backward compatible with previous versions of the Oracle
+It is important to use the officially supported version of the drivers 
+(10.2.0.1.0/11.2.0.x.0), which is backward compatible with previous versions of the Oracle
 server. It can be downloaded from 
-<ulink url="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html">
-http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html</ulink>.
+<ulink url="http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html">
+http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html</ulink>.
                     </para>
                 </listitem>
                 <listitem>
@@ -1211,7 +1211,22 @@ openjpa.ConnectionRetainMode: always
 Mapping persistent attributes to <link linkend="ref_guide_xmlmapping">XML columns</link> requires
 a JDBC 4 compliant driver if XML strings are longer than 4000 bytes, as counted in database.
 Otherwise an <literal>ORA-01461: can bind a LONG value only for insert into a LONG column</literal>
-error may result.
+error may result. This limitation is removed in Oracle jdbc driver 11.2.0.x.
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+If Oracle dictionary property <literal>MaxEmbeddedBlobSize</literal> or
+<literal>MaxEmbeddedClobSize</literal> is set to some limit (i.e. not -1) and embedded collection
+with blob/clob attribute is used, a 
+<literal>"org.apache.openjpa.persistence.ArgumentException:
+"x.y.z.EmbedOwner.embedCollection&lt;element:class x.y.z.EmbedValue&gt;"
+is mapped as embedded, but embedded field
+"x.y.z.EmbedOwner.embedCollection.x.y.z.EmbedValue.blob" is not embeddable. 
+Embedded element/key/value types are limited to simple fields and direct relations to other 
+persistent types"</literal> error may result. To overcome this limitation, either use jdbc driver
+11.2.0.x.0 (or later version) or set both <literal>MaxEmbeddedBlobSize</literal> and
+<literal>MaxEmbeddedClobSize</literal> oracle dictiionary properties to -1.
                     </para>
                 </listitem>
             </itemizedlist>