1212import jakarta .transaction .Status ;
1313
1414import org .hibernate .resource .transaction .spi .IsolationDelegate ;
15- import org .hibernate .internal .CoreMessageLogger ;
1615import org .hibernate .jpa .spi .JpaCompliance ;
1716import org .hibernate .resource .transaction .backend .jdbc .spi .JdbcResourceTransaction ;
1817import org .hibernate .resource .transaction .backend .jdbc .spi .JdbcResourceTransactionAccess ;
2524import org .hibernate .resource .transaction .spi .TransactionStatus ;
2625
2726import static java .util .Collections .emptyList ;
28- import static org .hibernate .internal .CoreLogging .messageLogger ;
27+ import static org .hibernate .engine .jdbc .JdbcLogging .JDBC_LOGGER ;
28+ import static org .hibernate .engine .jdbc .JdbcLogging .JDBC_MESSAGE_LOGGER ;
2929
3030/**
3131 * An implementation of {@link TransactionCoordinator} based on managing a
3636 * @see JdbcResourceTransaction
3737 */
3838public class JdbcResourceLocalTransactionCoordinatorImpl implements TransactionCoordinator {
39- private static final CoreMessageLogger log = messageLogger ( JdbcResourceLocalTransactionCoordinatorImpl .class );
4039
4140 private final TransactionCoordinatorBuilder transactionCoordinatorBuilder ;
4241 private final JdbcResourceTransactionAccess jdbcResourceTransactionAccess ;
@@ -92,7 +91,7 @@ public TransactionDriver getTransactionDriverControl() {
9291 @ Override
9392 public void explicitJoin () {
9493 // nothing to do here, but log a warning
95- log .callingJoinTransactionOnNonJtaEntityManager ();
94+ JDBC_MESSAGE_LOGGER .callingJoinTransactionOnNonJtaEntityManager ();
9695 }
9796
9897 @ Override
@@ -151,7 +150,7 @@ private void afterBeginCallback() {
151150 // report entering into a "transactional context"
152151 transactionCoordinatorOwner .startTransactionBoundary ();
153152
154- log .trace ( "Notifying resource-local transaction observers after begin" );
153+ JDBC_LOGGER .trace ( "Notifying resource-local transaction observers after begin" );
155154
156155 // trigger the Transaction-API-only after-begin callback
157156 transactionCoordinatorOwner .afterTransactionBegin ();
@@ -163,7 +162,7 @@ private void afterBeginCallback() {
163162 }
164163
165164 private void beforeCompletionCallback () {
166- log .trace ( "Notifying resource-local transaction observers before completion" );
165+ JDBC_LOGGER .trace ( "Notifying resource-local transaction observers before completion" );
167166 try {
168167 transactionCoordinatorOwner .beforeTransactionCompletion ();
169168 synchronizationRegistry .notifySynchronizationsBeforeTransactionCompletion ();
@@ -181,7 +180,7 @@ private void beforeCompletionCallback() {
181180 }
182181
183182 private void afterCompletionCallback (boolean successful ) {
184- log .trace ( "Notifying resource-local transaction observers after completion" );
183+ JDBC_LOGGER .trace ( "Notifying resource-local transaction observers after completion" );
185184 final int statusToSend = successful ? Status .STATUS_COMMITTED : Status .STATUS_ROLLEDBACK ;
186185 synchronizationRegistry .notifySynchronizationsAfterTransactionCompletion ( statusToSend );
187186 transactionCoordinatorOwner .afterTransactionCompletion ( successful , false );
@@ -231,7 +230,7 @@ public void begin() {
231230
232231 protected void errorIfInvalid () {
233232 if ( invalid ) {
234- throw new IllegalStateException ( "Physical- transaction delegate is no longer valid" );
233+ throw new IllegalStateException ( "Physical transaction delegate is no longer valid" );
235234 }
236235 }
237236
@@ -263,14 +262,14 @@ private void commitNoRollbackOnly() {
263262 }
264263 catch (RuntimeException e2 ) {
265264 e .addSuppressed ( e2 );
266- log .debug ( "Encountered failure rolling back failed commit" , e2 );
265+ JDBC_LOGGER .debug ( "Encountered failure rolling back failed commit" , e2 );
267266 }
268267 throw e ;
269268 }
270269 }
271270
272271 private void commitRollbackOnly () {
273- log .trace ( "On commit, transaction was marked for rollback only, rolling back" );
272+ JDBC_LOGGER .trace ( "On commit, transaction was marked for rollback only, rolling back" );
274273 rollback ();
275274 if ( jpaCompliance .isJpaTransactionComplianceEnabled () ) {
276275 throw new RollbackException ( "Transaction was marked for rollback only" );
@@ -301,8 +300,8 @@ public TransactionStatus getStatus() {
301300 @ Override
302301 public void markRollbackOnly () {
303302 if ( getStatus () != TransactionStatus .ROLLED_BACK ) {
304- if ( log .isTraceEnabled () ) {
305- log .trace ( "JDBC transaction marked for rollback only (exception provided for stack trace)" ,
303+ if ( JDBC_LOGGER .isTraceEnabled () ) {
304+ JDBC_LOGGER .trace ( "JDBC transaction marked for rollback only (exception provided for stack trace)" ,
306305 new Exception ( "exception just for purpose of providing stack trace" ) );
307306 }
308307 rollbackOnly = true ;
0 commit comments