You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by ht...@apache.org on 2011/08/08 20:53:55 UTC
svn commit: r1155056 - in /openjpa/trunk:
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/
openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/
openjpa-project/src/doc/manual/
Author: hthomann
Date: Mon Aug 8 18:53:55 2011
New Revision: 1155056
URL: http://svn.apache.org/viewvc?rev=1155056&view=rev
Log:
OPENJPA-1691: Added property for forward compatibility, documented property and migration considerations.
Modified:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.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=1155056&r1=1155055&r2=1155056&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 Aug 8 18:53:55 2011
@@ -104,6 +104,25 @@ public class OracleDictionary
* configure statements that it detects are operating on unicode fields.
*/
public boolean useSetFormOfUseForUnicode = true;
+
+ /**
+ * This variable was used prior to 2.1.x to indicate that OpenJPA should attempt to use
+ * a Reader-based JDBC 4.0 method to set Clob or XML data. It allowed XMLType and
+ * Clob values larger than 4000 bytes to be used. For 2.1.x+, code was added to allow
+ * said functionality by default (see OPENJPA-1691). For forward compatibility, this
+ * variable should not be removed.
+ */
+ @Deprecated
+ public boolean supportsSetClob = false;
+
+ /**
+ * If a user sets the previous variable (supportsSetClob) to true, we should log a
+ * warning indicating that the variable no longer has an effect due to the code changes
+ * of OPENJPA-1691. We only want to log the warning once per instance, thus this
+ * variable will be used to indicate if the warning should be printed or not.
+ */
+ @Deprecated
+ private boolean logSupportsSetClobWarning = true;
/**
* Type constructor for XML column, used in INSERT and UPDATE statements.
@@ -572,6 +591,20 @@ public class OracleDictionary
public void setClobString(PreparedStatement stmnt, int idx, String val,
Column col)
throws SQLException {
+
+ //We need a place to detect if the user is setting the 'supportsSetClob' property.
+ //While in previous releases this property had meaning, it is no longer useful
+ //given the code added via OPENJPA-1691. As such, we need to warn user's the
+ //property no longer has meaning. While it would be nice to have a better way
+ //to detect if the supportsSetClob property has been set, the best we can do
+ //is detect the variable in this code path as this is the path a user's code
+ //would go down if they are still executing code which actually made use of
+ //the support provided via setting supportsSetClob.
+ if (supportsSetClob && logSupportsSetClobWarning){
+ log.warn(_loc.get("oracle-set-clob-warning"));
+ logSupportsSetClobWarning=false;
+ }
+
if (col.isXML()) {
if (isJDBC4) {
// This JDBC 4 method handles values longer than 4000 bytes.
Modified: openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties?rev=1155056&r1=1155055&r2=1155056&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties Mon Aug 8 18:53:55 2011
@@ -221,3 +221,6 @@ sequencesql-override: Going to override
string and the string set in the property and will further allow openJPA to use the \
string defined by the property rather than the default string for DB2.
invalid-locking-mode: Invalid locking mode for SolidDB: "{0}"
+oracle-set-clob-warning: Setting the supportsSetClob property on the OracleDictionary no longer has an \
+ effect. Code has been added to allow, by default, the functionality provided in previous releases \
+ via the supportsSetClob property.
Modified: openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml?rev=1155056&r1=1155055&r2=1155056&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml Mon Aug 8 18:53:55 2011
@@ -433,6 +433,17 @@
</itemizedlist>
</para>
</section>
+ <section id="SupportsSetClob">
+ <title>
+ supportsSetClob property.
+ </title>
+ <!-- See OPENJPA-1691 for details. -->
+ <para>
+ In the OpenJPA 2.1.x release, code was added to OpenJPA to allow the setting of Clob or XML data larger than 4000 bytes. This functionality
+ was eventually back ported to previous releases, and enabeld by the supportsSetClob property on the OracleDictionary. Setting this property
+ has no effect in 2.1.x and later releases and any occurrence of it should be removed.
+ </para>
+ </section>
</section>
</section>
</appendix>
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml?rev=1155056&r1=1155055&r2=1155056&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml Mon Aug 8 18:53:55 2011
@@ -3865,6 +3865,18 @@ on database configuration, e.g. encoding
CLOB to persist with the embedded method. Defaults to 4000 characters.
</para>
</listitem>
+ <listitem id="OracleDictionary.SupportsSetClob">
+ <para>
+<literal>SupportsSetClob</literal>: This property was used in previous releases
+to indicate that OpenJPA should attempt to use a Reader-based JDBC 4.0 method to
+set Clob or XML data. It allowed XMLType and Clob values larger than 4000 bytes
+to be used. For this release, and newer, code was added to allow said
+functionality by default (see OPENJPA-1691). For forward compatibility, this
+property still remains, however it has been deprecated and will eventually be
+removed. Setting this property has no effect and any occurrence of it should
+be removed.
+ </para>
+ </listitem>
<listitem id="OracleDictionary.UseSetFormOfUseForUnicode">
<para>
<literal>UseSetFormOfUseForUnicode</literal>: Prior to Oracle 10i, statements