Skip to content

Commit

Permalink
Fixed UpsertTest by running DB setup in a separate transaction so tha…
Browse files Browse the repository at this point in the history
…t records are

committed to the database before the upsert operation begins.
  • Loading branch information
soleger committed Mar 14, 2014
1 parent 84ca85e commit 66c34d2
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -47,6 +47,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
Expand Down Expand Up @@ -98,6 +99,7 @@ public void afterPropertiesSet() throws Exception {

@Before
public void setUp() {
m_transTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
m_transTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
Expand Down

0 comments on commit 66c34d2

Please sign in to comment.