Skip to content

Commit 7f98910

Browse files
committed
docs: clarify Context-abort comment and link #1353 (Copilot review)
1 parent fbc8d58 commit 7f98910

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dspace-server-webapp/src/main/java/org/dspace/app/rest/security/StatelessAuthenticationFilter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ protected void doFilterInternal(HttpServletRequest req,
106106
try {
107107
chain.doFilter(req, res);
108108
} finally {
109-
// Complete the context to avoid transactions getting stuck in the connection pool in the
110-
// `idle in transaction` state.
111-
// TODO add the issue url
109+
// Abort the request-scoped DSpace Context if it is still open, so a leaked, dirty
110+
// Hibernate session is not left bound to the worker thread (prevents orphaned items).
111+
// See https://github.com/dataquest-dev/DSpace/issues/1353
112112
Context context = (Context) req.getAttribute(ContextUtil.DSPACE_CONTEXT);
113113
// Ensure the context is cleared after the request is done
114114
if (context != null && context.isValid()) {

0 commit comments

Comments
 (0)