Skip to content

Commit

Permalink
Merge pull request #29 from ebean-orm/feature/bump-flush
Browse files Browse the repository at this point in the history
Use System.Logger and transaction.flush()
  • Loading branch information
rbygrave authored Sep 5, 2022
2 parents 610afd3 + 3be3741 commit 65f5516
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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>

Expand All @@ -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>
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -15,6 +14,8 @@
import javax.sql.DataSource;
import java.util.List;

import static java.lang.System.Logger.Level.DEBUG;

/**
* A Spring-aware {@link ExternalTransactionManager}.
* <p>
Expand All @@ -26,7 +27,7 @@
*/
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.
Expand Down Expand Up @@ -153,7 +154,7 @@ SpringJdbcTransaction getTransaction() {

@Override
public void flush() {
transaction.flushBatch();
transaction.flush();
}

@Override
Expand All @@ -167,12 +168,12 @@ public void beforeCommit(boolean readOnly) {
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;

Expand Down

0 comments on commit 65f5516

Please sign in to comment.