This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch postgresql
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 77ab188dd6ac66ce0361338f546898cce90babb3
Author: Quan Tran <hqt...@linagora.com>
AuthorDate: Thu Dec 7 14:06:40 2023 +0700

    JAMES-2586 PostgresExecutor: better recognize prepared statement conflict
    
    Otherwise, we could retry on other fatal errors like: 
io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: column 
"domain" of relation "mailbox" already exists.
---
 .../org/apache/james/backends/postgres/utils/PostgresExecutor.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
 
b/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
index b530405f09..686145dbeb 100644
--- 
a/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
+++ 
b/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
@@ -121,6 +121,8 @@ public class PostgresExecutor {
     }
 
     private Predicate<Throwable> preparedStatementConflictException() {
-        return throwable -> throwable.getCause() instanceof 
R2dbcBadGrammarException;
+        return throwable -> throwable.getCause() instanceof 
R2dbcBadGrammarException
+            && throwable.getMessage().contains("prepared statement")
+            && throwable.getMessage().contains("already exists");
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to