Compare commits

..
Author SHA1 Message Date
rob bygrave 035c5570c3 [maven-release-plugin] prepare release ebean-spring-txn-12.6.3 2020-12-18 15:29:25 +13:00
rob bygrave 0be0fd1e05 Bump to 12.6.3-SNAPSHOT 2020-12-18 15:28:31 +13:00
rob bygrave bdfd380687 #23 - Use updated PostCommit to send ChangeLog changes. Use PreCommit to flush last ChangeLog changes at PreCommit 2020-12-18 14:55:57 +13:00
rob bygrave d1a4c73cd6 [maven-release-plugin] prepare for next development iteration 2020-12-18 10:01:04 +13:00
rob bygrave 7133c81fc5 [maven-release-plugin] prepare release ebean-spring-txn-12.4.2 2020-12-18 10:00:52 +13:00
rob bygrave c6b4de39e8 Merge branch 'master' of github.com:ebean-orm/ebean-spring-txn 2020-12-18 09:58:30 +13:00
rob bygrave 94f367af70 #22 - Spring @Transactional with batch mode not invoking ebean batch flush 2020-12-18 09:58:16 +13:00
Rob BygraveandGitHub dc6c393300 Merge pull request #21 from ebean-orm/dependabot/maven/junit-junit-4.13.1
Bump junit from 4.12 to 4.13.1
2020-10-13 22:55:00 +13:00
dependabot[bot]andGitHub 239f3a0a54 Bump junit from 4.12 to 4.13.1
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 07:51:29 +00:00
rob bygrave d3e78ab54e [maven-release-plugin] prepare for next development iteration 2020-09-18 01:15:35 +12:00
rob bygrave c6483535bd [maven-release-plugin] prepare release ebean-spring-txn-12.4.1 2020-09-18 01:15:24 +12:00
rob bygrave 95bb2a5d56 Bump to 12.4.1 2020-09-18 01:14:52 +12:00
rob bygrave 23649ed840 [maven-release-plugin] prepare for next development iteration 2020-03-13 17:12:25 +13:00
rob bygrave 3ee4034a76 [maven-release-plugin] prepare release ebean-spring-txn-12.2.1 2020-03-13 17:12:15 +13:00
rob bygrave 21d377546e Bump to 12.2.1 2020-03-13 17:10:21 +13:00
rob bygrave 8c9dccc6a3 [maven-release-plugin] prepare for next development iteration 2019-10-14 14:53:28 +13:00
4 changed files with 28 additions and 19 deletions
+15 -8
View File
@@ -5,12 +5,12 @@
<parent>
<groupId>org.avaje</groupId>
<artifactId>java8-oss</artifactId>
<version>2.1</version>
<version>2.3</version>
</parent>
<groupId>io.ebean</groupId>
<artifactId>ebean-spring-txn</artifactId>
<version>12.1.1</version>
<version>12.6.3</version>
<name>ebean-spring-txn</name>
<packaging>jar</packaging>
@@ -25,24 +25,31 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean-spring-txn.git</developerConnection>
<tag>ebean-spring-txn-12.1.1</tag>
<tag>ebean-spring-txn-12.6.3</tag>
</scm>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<version>1.7.30</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>12.1.1</version>
<version>12.6.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
<scope>test</scope>
</dependency>
<!-- Provided: Spring, Spring Boot -->
<dependency>
<groupId>org.springframework</groupId>
@@ -81,7 +88,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
@@ -120,11 +127,11 @@
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.15</version>
<version>2.18</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:12.1.1</tile>
<tile>io.ebean.tile:enhancement:12.6.1</tile>
</tiles>
</configuration>
</plugin>
@@ -49,7 +49,6 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
*/
@Override
public void setTransactionManager(Object txnMgr) {
// RB: At this stage not exposing TransactionManager to
// the public API and hence the Object type and casting here
this.transactionManager = (TransactionManager) txnMgr;
@@ -64,10 +63,8 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
*/
@Override
public Object getCurrentTransaction() {
// Get the current Spring ConnectionHolder associated to the current spring managed transaction
ConnectionHolder holder = (ConnectionHolder) TransactionSynchronizationManager.getResource(dataSource);
if (holder == null || !holder.isSynchronizedWithTransaction()) {
// no current Spring transaction
SpiTransaction currentEbeanTransaction = transactionManager.getInScope();
@@ -90,7 +87,6 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
// Create and register a Spring TransactionSynchronization for this transaction
springTxnLister = createSpringTxnListener(newTrans);
TransactionSynchronizationManager.registerSynchronization(springTxnLister);
return transactionManager.externalBeginTransaction(newTrans, TxScope.required());
}
}
@@ -102,7 +98,6 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
* </p>
*/
private SpringTxnListener getSpringTxnListener() {
if (TransactionSynchronizationManager.isSynchronizationActive()) {
List<TransactionSynchronization> synchronizations = TransactionSynchronizationManager.getSynchronizations();
if (synchronizations != null) {
@@ -114,7 +109,6 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
}
}
}
return null;
}
@@ -164,22 +158,22 @@ public class SpringJdbcTransactionManager implements ExternalTransactionManager
@Override
public void beforeCommit(boolean readOnly) {
// Future note: for JPA2 locking we will
// have beforeCommit events to fire
if (!readOnly) {
transaction.preCommit();
}
}
@Override
public void afterCompletion(int status) {
switch (status) {
case STATUS_COMMITTED:
log.debug("Spring Txn [{}] committed", transaction.getId());
transactionManager.notifyOfCommit(transaction);
transaction.postCommit();
break;
case STATUS_ROLLED_BACK:
log.debug("Spring Txn [{}] rollback", transaction.getId());
transactionManager.notifyOfRollback(transaction, null);
transaction.postRollback(null);
break;
default:
@@ -1,5 +1,6 @@
package org.example;
import io.ebean.annotation.PersistBatch;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
@@ -31,6 +32,7 @@ public class EbeanServerFactoryBean implements InitializingBean, FactoryBean<Ebe
throw new Exception("No ServerConig set. You must define a ServerConfig bean");
}
serverConfig.setPersistBatch(PersistBatch.ALL);
// Create the new EbeanServer using the configuration
this.ebeanServer = EbeanServerFactory.create(serverConfig);
}
@@ -1,5 +1,6 @@
package org.example;
import io.ebean.DB;
import io.ebean.Ebean;
import io.ebean.Transaction;
import org.junit.Test;
@@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -74,6 +76,10 @@ public class EbeanSpringModuleTest {
user.setName("ebean");
userService.save(user);
logger.info("Saved new User");
assertThat(user.getOid()).isGreaterThan(0);
final User found = DB.find(User.class, user.getOid());
assertThat(found).isNotNull();
}
/**