Skip to content

Commit

Permalink
Fix uses of transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
osvaldjr committed Aug 1, 2019
1 parent f85605b commit 4881f32
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<groupId>io.github.osvaldjr</groupId>
<artifactId>easy-cucumber</artifactId>
<packaging>jar</packaging>
<version>0.0.10</version>
<version>0.0.11</version>
<name>io.github.osvaldjr:easy-cucumber</name>
<description>Easy Cucumber JVM Testing</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class DatabaseBulkSQLInsertUseCase {

@Transactional
public void execute(String sql) {
entityManager.joinTransaction();
entityManager.createNativeQuery(sql).executeUpdate();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void execute(String tableName, List<TreeMap> lines) {
String columns = getColumns(lines.get(0));
String values = getInsertValues(lines);
String query = format("INSERT INTO %s (%s) VALUES %s;", tableName, columns, values);
entityManager.joinTransaction();
entityManager.createNativeQuery(query).executeUpdate();
}

Expand Down

0 comments on commit 4881f32

Please sign in to comment.