Skip to content

Commit c79b134

Browse files
refactor: Rename variable is_outermost to is_outermost_transaction for improving readability.
1 parent 4699eaf commit c79b134

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

py_spring_model/core/session_context_holder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ def Transactional(func: Callable[..., Any]) -> Callable[..., Any]:
1717
"""
1818
@wraps(func)
1919
def wrapper(*args, **kwargs):
20-
is_outermost = not SessionContextHolder.has_session()
20+
is_outermost_transaction = not SessionContextHolder.has_session()
2121
session = SessionContextHolder.get_or_create_session()
2222
try:
2323
result = func(*args, **kwargs)
24-
if is_outermost:
24+
if is_outermost_transaction:
2525
session.commit()
2626
return result
2727
except Exception as error:
28-
if is_outermost:
28+
if is_outermost_transaction:
2929
session.rollback()
3030
raise error
3131
finally:
32-
if is_outermost:
32+
if is_outermost_transaction:
3333
SessionContextHolder.clear_session()
3434
return wrapper
3535

0 commit comments

Comments
 (0)