Skip to content

Commit

Permalink
leave entities attached
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 6, 2022
1 parent 5b648e1 commit 4be7001
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/main/java/io/cryostat/discovery/PluginInfoDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public PluginInfo update(UUID id, EnvironmentNode subtree) {
plugin.setSubtree(gson.toJson(subtree));
entityManager.merge(plugin);
transaction.commit();
entityManager.detach(plugin);

return plugin;
} catch (Exception e) {
Expand Down Expand Up @@ -130,7 +129,6 @@ public PluginInfo update(UUID id, Collection<? extends AbstractNode> children) {
plugin.setSubtree(gson.toJson(subtree));
entityManager.merge(plugin);
transaction.commit();
entityManager.detach(plugin);

return plugin;
} catch (Exception e) {
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/io/cryostat/storage/AbstractDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public final T save(T t) {
transaction.begin();
entityManager.persist(t);
transaction.commit();
entityManager.detach(t);
return t;
} catch (Exception e) {
if (transaction != null) {
Expand Down Expand Up @@ -103,9 +102,6 @@ public final Optional<T> get(I id) {
EntityTransaction transaction = entityManager.getTransaction();
try {
T t = entityManager.find(klazz, id);
if (t != null) {
entityManager.detach(t);
}
return Optional.ofNullable(t);
} catch (Exception e) {
if (transaction != null) {
Expand Down

0 comments on commit 4be7001

Please sign in to comment.