mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: possible resource leaking in testcases (all created transactions are closed by followed try statement) (#1273)
This commit is contained in:
committed by
Rob Bygrave
parent
8e9843ab8a
commit
e3425a8850
@@ -96,18 +96,20 @@ public class TestSqlUpdateInTxn extends BaseTestCase {
|
||||
|
||||
|
||||
Ebean.beginTransaction();
|
||||
try {
|
||||
SqlUpdate update = Ebean.createSqlUpdate(updateDml);
|
||||
update.setParameter("desc", "foo4");
|
||||
update.setParameter("id", id);
|
||||
update.execute();
|
||||
|
||||
SqlUpdate update = Ebean.createSqlUpdate(updateDml);
|
||||
update.setParameter("desc", "foo4");
|
||||
update.setParameter("id", id);
|
||||
update.execute();
|
||||
|
||||
updateMod = Ebean.createSqlUpdate(updateModDml);
|
||||
updateMod.setParameter("desc", "mod2");
|
||||
updateMod.execute();
|
||||
|
||||
Ebean.commitTransaction();
|
||||
updateMod = Ebean.createSqlUpdate(updateModDml);
|
||||
updateMod.setParameter("desc", "mod2");
|
||||
updateMod.execute();
|
||||
|
||||
Ebean.commitTransaction();
|
||||
} finally {
|
||||
Ebean.endTransaction();
|
||||
}
|
||||
AuditLog log5 = Ebean.find(AuditLog.class, log.getId());
|
||||
Assert.assertEquals("foo4", log5.getDescription());
|
||||
Assert.assertEquals("mod2", log5.getModifiedDescription());
|
||||
|
||||
Reference in New Issue
Block a user