Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-2282

Some Cassandra DAOs are not bound in Singleton scope

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • master
    • None
    • cassandra, guice
    • None

    Description

      We encounter some log lines like:

      Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='UPDATE mailboxCounters SET unseen=unseen-1 WHERE mailboxId=:mailboxId;'
      Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='UPDATE mailboxCounters SET count=count-1 WHERE mailboxId=:mailboxId;'
      Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='UPDATE mailboxCounters SET unseen=unseen+1 WHERE mailboxId=:mailboxId;'
      Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once. Query='INSERT INTO mailbox (id,name,uidvalidity,mailboxbase) VALUES (:id,:name,:uidvalidity,:mailboxbase);'
      

      These DAOs are created every time they are injected by Guice, which leads to re-preparing queries.

      We should rather bind them in scope singleton.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            btellier Benoit Tellier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment