0 Replies Latest reply on Aug 17, 2006 5:38 PM by sappenin

    MailboxServiceImpl Bug

    sappenin Novice

      When I try to retrieve messages via POP3, JBCS throws an error when it tries to call the "deleteMarked()" function. I've tracked the error down to MailboxServiceImpl Line 772, where fastExpunge issues a native Postgres query that postgres doesn't like.

      The broken code is:

       session.createNativeQuery("delete from MessageData_BODYID b where b.MessageData_ID in (select m.id from MessageData m where m.deleted = true" + " and m.folder_id = :folder)").setParameter("folder", f.getId()).executeUpdate();
      


      In my SQL window, I was able to issue a SQL query as follows:

      delete from MessageData_BODYID where MessageData_BODYID.MessageData_ID in (select m.id from MessageData m where m.deleted = true" + " and m.folder_id = :folder)
      


      Basically, it appears that postgres doesn't like/allow the aliasing of tables (instead of "MessageData_BODYID as b where b.MessageData_ID", I just use the full table name "MessageData_BODYID where MessageData_BODYID.MessageData_ID").

      That seems wierd to me, so I'm wondering if anyone has this problem with postgres. If others concur, I'll post a JIRA task with a fix.

      david