Skip to content

Commit b95fe27

Browse files
fix: Update session clearing condition in SessionContextHolder
- Changed the condition for clearing the session from checking if the depth is 0 to using TransactionalDepth.ON_EXIT.value for better clarity and alignment with transaction management.
1 parent b22e3db commit b95fe27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py_spring_model/core/session_context_holder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def exit_session(cls) -> int:
119119
cls._session_depth.set(new_depth)
120120

121121
# Clear session only when depth reaches 0 (outermost level)
122-
if new_depth == 0:
122+
if new_depth == TransactionalDepth.ON_EXIT.value:
123123
cls.clear_session()
124124

125125
return new_depth

0 commit comments

Comments
 (0)