Skip to content

Commit 589c5b7

Browse files
committed
[hibernate#2181] Add log message for JDBCExceptions
I'm going to add this because ORM log this message when a JDBCException happens. I don't expect it to happen in Hibernate Reactive, but I don't have time now to check for sure.
1 parent 3026312 commit 589c5b7

File tree

1 file changed

+10
-0
lines changed
  • hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl

1 file changed

+10
-0
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import jakarta.persistence.PersistenceException;
1313

1414
import org.hibernate.HibernateException;
15+
import org.hibernate.JDBCException;
1516
import org.hibernate.LazyInitializationException;
1617
import org.hibernate.cache.CacheException;
1718
import org.hibernate.dialect.Dialect;
@@ -24,6 +25,7 @@
2425
import org.jboss.logging.annotations.Message;
2526
import org.jboss.logging.annotations.MessageLogger;
2627

28+
import static org.jboss.logging.Logger.Level.DEBUG;
2729
import static org.jboss.logging.Logger.Level.ERROR;
2830
import static org.jboss.logging.Logger.Level.INFO;
2931
import static org.jboss.logging.Logger.Level.WARN;
@@ -315,4 +317,12 @@ public interface Log extends BasicLogger {
315317
@LogMessage(level = WARN)
316318
@Message( id= 494, value = "Attempt to merge an uninitialized collection with queued operations; queued operations will be ignored: %s")
317319
void ignoreQueuedOperationsOnMerge(String collectionInfoString);
320+
321+
// Same method in ORM
322+
@LogMessage(level = DEBUG)
323+
@Message(value = "JDBCException was thrown for a transaction marked for rollback. " +
324+
" This is probably due to an operation failing fast due to the transaction being marked for rollback.",
325+
id = 520)
326+
void jdbcExceptionThrownWithTransactionRolledBack(@Cause JDBCException e);
327+
318328
}

0 commit comments

Comments
 (0)