openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtyle...@apache.org
Subject svn commit: r895408 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
Date Sun, 03 Jan 2010 15:10:43 GMT
Author: mtylenda
Date: Sun Jan  3 15:10:42 2010
New Revision: 895408

URL: http://svn.apache.org/viewvc?rev=895408&view=rev
Log:
OPENJPA-1248: PostgreSQL needs truncating LOB content on update when new content is shorter
than the existing content.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java?rev=895408&r1=895407&r2=895408&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
Sun Jan  3 15:10:42 2010
@@ -458,7 +458,8 @@
                 if (ob != null) {
                     LargeObject lo = lom.open(oid, LargeObjectManager.WRITE);
                     OutputStream os = lo.getOutputStream();
-                    copy((InputStream)ob, os);
+                    long size = copy((InputStream) ob, os);
+                    lo.truncate((int) size);
                     lo.close();
                 } else {
                     lom.delete(oid);



Mime
View raw message