This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit ee0028e8bb15aab16315751836c31560c85681c5 Author: Benoit Tellier <[email protected]> AuthorDate: Wed Apr 15 22:31:33 2020 +0700 JAMES-2897 Insert statements needs ifNotExist when LWT is used in inserts This is an example developped in https://docs.datastax.com/en/ddac/doc/datastax_enterprise/dbInternals/dbIntLtwtTransactions.html For example, the following series of operations can fail: ``` DELETE ... INSERT .... IF NOT EXISTS SELECT .... ``` The following series of operations will work: ``` DELETE ... IF EXISTS INSERT .... IF NOT EXISTS SELECT ..... ``` --- .../james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAO.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAO.java index 7eb2062..0725bcc 100644 --- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAO.java +++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAO.java @@ -109,7 +109,8 @@ public class CassandraMessageIdToImapUidDAO { .value(RECENT, bindMarker(RECENT)) .value(SEEN, bindMarker(SEEN)) .value(USER, bindMarker(USER)) - .value(USER_FLAGS, bindMarker(USER_FLAGS))); + .value(USER_FLAGS, bindMarker(USER_FLAGS)) + .ifNotExists()); } private PreparedStatement prepareUpdate(Session session) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
