mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 07:51:04 +00:00
Change to use System.Logger + transaction.flush()
This commit is contained in:
@@ -33,28 +33,28 @@
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.30</version>
|
||||
<version>2.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.0.0</version>
|
||||
<version>13.9.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.0.0</version>
|
||||
<version>13.9.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.13.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -96,21 +96,21 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.1</version>
|
||||
<version>4.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.23.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>2.1.210</version>
|
||||
<version>2.1.214</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<version>[1.7,)</version>
|
||||
<version>2.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -139,7 +139,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.0.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.9.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package io.ebean.spring.txn;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.TxScope;
|
||||
import io.ebean.config.ExternalTransactionManager;
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
import io.ebeaninternal.server.transaction.TransactionManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.jdbc.datasource.ConnectionHolder;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
|
||||
@@ -15,6 +14,8 @@ import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* A Spring-aware {@link ExternalTransactionManager}.
|
||||
* <p>
|
||||
@@ -26,7 +27,7 @@ import java.util.List;
|
||||
*/
|
||||
public class SpringJdbcTransactionManager implements ExternalTransactionManager {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SpringJdbcTransactionManager.class);
|
||||
private static final System.Logger log = AppLog.getLogger(SpringJdbcTransactionManager.class);
|
||||
|
||||
/**
|
||||
* The data source.
|
||||
@@ -153,7 +154,7 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
transaction.flushBatch();
|
||||
transaction.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,12 +168,12 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
|
||||
public void afterCompletion(int status) {
|
||||
switch (status) {
|
||||
case STATUS_COMMITTED:
|
||||
log.debug("Spring Txn [{}] committed", transaction.getId());
|
||||
log.log(DEBUG, "Spring Txn [{0}] committed", transaction.getId());
|
||||
transaction.postCommit();
|
||||
break;
|
||||
|
||||
case STATUS_ROLLED_BACK:
|
||||
log.debug("Spring Txn [{}] rollback", transaction.getId());
|
||||
log.log(DEBUG, "Spring Txn [{0}] rollback", transaction.getId());
|
||||
transaction.postRollback(null);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user