EJB Cluster & File uploads

Discussions

Performance and scalability: EJB Cluster & File uploads

  1. EJB Cluster & File uploads (3 messages)

    We have an application running on a single instance servlet engine.
    I want to move single server approach to our weblogic cluster to upload and validate excel files. I am trying to find out a way to store the uploaded files in the file system before starting to read and validate the data.

    Do you have any ideas?

    Regards,
    Koray
  2. EJB Cluster & File uploads[ Go to top ]

    this code fragment works on Bea Portal 7 but will work on WLS only changing the multi part parser section

        try {
          MultipartParser parser = new MultipartParser(req);
          Part part = parser.readNextPart();

          while (part != null)
          {
            if (part.getName().equals("fileRS") && part.isFile())
            {
              filePart = (FilePart) part;
              tmpFile = File.createTempFile("tmpRS",".zip");
              tempFileName = tmpFile.getAbsolutePath();
              filePart.writeTo(tmpFile);
              tmpFile.close();
              break;
            }
            part = parser.readNextPart();
          }
          examineUploadedFile(tempFileName);
          if (tmpFile != null)
            tmpFile.delete();
        }
        catch (IOException ex) {
          log.error("Error processing uploaded file",ex);
          throw new ProcessingException(ex);
        }

    Bye, Stefano
  3. EJB Clustering and temp directory[ Go to top ]

    I use temp directory if I use clustering (disteributed to the different computers) will i get always the same locaation for the temp directory?
    I mean will it be always the same computer and the same temp directory that i am getting?
  4. I use temp directory if I use clustering (disteributed to the different computers) will i get always the same locaation for the temp directory? I mean will it be always the same computer and the same temp directory that i am getting?
    If you plan to upload files to a cluster, you must validate that the filesystem where you store the files is shared across all the machines that form the cluster. For example, if you are saving the excel files in a directory of one of the machines such as....

      /apps/uploadedFiles

    ... you must share this directory via NFS in order to mount this directory in the other machines of the cluster. If you don't do this, then maybe you are going to get errors if for example you upload a file with one server of the cluster, and then - a week ago - you try to read this file, but the request gets served by other machine of the cluster.


    Jose R.

    http://www.terra.es/personal/jrhuerga