Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-787

Error with Oracle when accessing Outbox - something along the lines of unexpected type clob

    XMLWordPrintable

    Details

      Description

      Currently in the org.olat.core.util.mail.manager.MailManager class, there is a distinct clause put around selecting mail

      public List<DBMail> getOutbox(Identity from, int firstResult, int maxResults) {
      StringBuilder sb = new StringBuilder();
      sb.append("select distinct(mail) from ").append(DBMailImpl.class.getName()).append(" mail")

      This is causing an error with Oracle where Oracle claims about an unexpected type or something like that for clob.

      I noticed in the getInbox method, distinct is not being used. So, I removed it in getOutbox and the error went way.

      Is the distinct clause needed in getOutbox?

      Here's my patch:

      diff --git a/src/main/java/org/olat/core/util/mail/manager/MailManager.java b/src/main/java/org/olat/core/util/mail/manager/MailManager.java
      — a/src/main/java/org/olat/core/util/mail/manager/MailManager.java
      +++ b/src/main/java/org/olat/core/util/mail/manager/MailManager.java
      @@ -365,7 +365,7 @@
      */
      public List<DBMail> getOutbox(Identity from, int firstResult, int maxResults) {
      StringBuilder sb = new StringBuilder();

      • sb.append("select distinct(mail) from ").append(DBMailImpl.class.getName()).append(" mail")
        + sb.append("select mail from ").append(DBMailImpl.class.getName()).append(" mail")
        .append(" inner join fetch mail.from fromRecipient")
        .append(" inner join fromRecipient.recipient fromRecipientIdentity")
        .append(" inner join fetch mail.recipients recipient")

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              bhedrick Brooke Hedrick
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: