Skip to content

Commit

Permalink
:enh: performance improvement (avoid recreating the entire KapuaEntit…
Browse files Browse the repository at this point in the history
…y;ManagerFactory every time)

Signed-off-by: dseurotech <[email protected]>
  • Loading branch information
dseurotech committed Aug 2, 2023
1 parent dc432a7 commit cf1f199
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public KapuaJpaTxManagerFactory(int maxInsertAttempts) {
}

public TxManager create(String persistenceUnitName) {
return new TxManagerImpl(() -> new JpaTxContext(new KapuaEntityManagerFactory(persistenceUnitName)), maxInsertAttempts);
final KapuaEntityManagerFactory entityManagerFactory = new KapuaEntityManagerFactory(persistenceUnitName);
return new TxManagerImpl(() -> new JpaTxContext(entityManagerFactory), maxInsertAttempts);
}
}

0 comments on commit cf1f199

Please sign in to comment.