Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-1717

Anti-social size determination for attachments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2RC2
    • None
    • SAAJ
    • None

    Description

      The following code is taken from AttachmentPart method getSize():

      public int getSize() throws SOAPException {
      if (datahandler == null)

      { return 0; }

      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      try

      { datahandler.writeTo(bout); }

      catch (java.io.IOException ex)

      { log.error(Messages.getMessage("javaIOException00"), ex); throw new SOAPException(Messages.getMessage("javaIOException01", ex.getMessage()), ex); }

      return bout.size();
      }

      My understanding is that when the attachment is large the entire attachment will be stored in memory (in the ByteArrayOutputStream). This is unfortunate considering the elegant ManagedMemoryDataSource approach of keeping large attachments out of memory.

      The class DimeBodyPart implementation of getDataSize() is perhaps a template for improving this behaviour.

      Attachments

        Activity

          People

            Unassigned Unassigned
            seanbarnett Sean Barnett
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: