james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgoldst...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/mailrepository JDBCMailRepository.java
Date Fri, 13 Sep 2002 16:02:05 GMT
pgoldstein    2002/09/13 09:02:05

  Modified:    src/java/org/apache/james/mailrepository
                        JDBCMailRepository.java
  Log:
  Fixed bug #12622 - issue with length limitations inside Oracle JDBC driver.
  
  Thanks to Prince Chellarajan for both raising the issue and submitting the resolution.
  
  Revision  Changes    Path
  1.25      +8 -2      jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java
  
  Index: JDBCMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JDBCMailRepository.java	23 Aug 2002 08:00:28 -0000	1.24
  +++ JDBCMailRepository.java	13 Sep 2002 16:02:05 -0000	1.25
  @@ -34,6 +34,7 @@
   import org.apache.mailet.MailAddress;
   
   import javax.mail.internet.MimeMessage;
  +import java.io.ByteArrayInputStream;
   import java.io.ByteArrayOutputStream;
   import java.io.File;
   import java.io.IOException;
  @@ -488,7 +489,9 @@
                               MimeMessageWrapper.writeTo(messageBody, headerOut, bodyOut);
           
                               //Store the headers in the database
  -                            updateMessage.setBytes(1, headerOut.toByteArray());
  +                            ByteArrayInputStream headerInputStream =
  +                                new ByteArrayInputStream(headerOut.toByteArray());
  +                            updateMessage.setBinaryStream(1, headerInputStream, headerOut.size());
                           } finally {
                               closeOutputStreams(headerOut, bodyOut);
                           }
  @@ -541,7 +544,10 @@
           
                           //Write the message to the headerOut and bodyOut.  bodyOut goes
straight to the file
                           MimeMessageWrapper.writeTo(messageBody, headerOut, bodyOut);
  -                        insertMessage.setBytes(10, headerOut.toByteArray());
  +
  +                        ByteArrayInputStream headerInputStream =
  +                            new ByteArrayInputStream(headerOut.toByteArray());
  +                        insertMessage.setBinaryStream(10, headerInputStream, headerOut.size());
                       } finally {
                           closeOutputStreams(headerOut, bodyOut);
                       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message