Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PythonSpring/pyspring-model
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: PythonSpring/pyspring-model
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feat/persistence-context
Choose a head ref
  • 15 commits
  • 14 files changed
  • 1 contributor

Commits on Jun 19, 2025

  1. Implement Session Management and Transactional Decorator for CRUD Ope…

    …rations
    
    - Introduced `SessionContextHolder` to manage SQLAlchemy sessions using context variables.
    - Added `Transactional` decorator to ensure session commits and rollbacks during CRUD operations.
    - Refactored `CrudRepository` methods to utilize the new session management, enhancing code clarity and reducing session handling boilerplate.
    - Updated tests to reflect changes in the repository methods, ensuring proper functionality without session parameters.
    William-W-Chen committed Jun 19, 2025
    Configuration menu
    Copy the full SHA
    a7f4a65 View commit details
    Browse the repository at this point in the history
  2. Refactor CRUD Operations to Utilize SessionContextHolder for Session …

    …Management
    
    - Updated CRUD methods in `PySpringModelRestService` and `CrudRepositoryImplementationService` to use `SessionContextHolder` for session handling, replacing the previous context manager approach.
    - Added `@Transactional` decorator to relevant methods to ensure proper transaction management.
    - Enhanced error handling in the `Transactional` decorator to raise specific exceptions.
    - Updated tests to clear session state before and after tests to maintain isolation and prevent side effects.
    William-W-Chen committed Jun 19, 2025
    Configuration menu
    Copy the full SHA
    708906d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6e2631e View commit details
    Browse the repository at this point in the history
  4. feat: Enhanced @transactional decorator with smart session management

    - Implement outermost transaction detection using SessionContextHolder.has_session()
    - Session lifecycle (commit/rollback/close) only managed by outermost @transactional
    - Nested @transactional methods reuse existing session without interference
    - Prevent premature session closure in nested transaction scenarios
    - Maintain transaction integrity across multiple decorated method calls
    William-W-Chen committed Jun 19, 2025
    Configuration menu
    Copy the full SHA
    4699eaf View commit details
    Browse the repository at this point in the history
  5. refactor: Rename variable is_outermost to `is_outermost_transaction…

    …` for improving readability.
    William-W-Chen committed Jun 19, 2025
    Configuration menu
    Copy the full SHA
    c79b134 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7ce0e35 View commit details
    Browse the repository at this point in the history
  7. refactor: Clean up documentation in @transactional decorator

    - Removed commented-out explanations for clarity.
    - Streamlined the docstring to focus on the transaction behavior of the decorator.
    William-W-Chen committed Jun 19, 2025
    Configuration menu
    Copy the full SHA
    7c7cc55 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4e7b847 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8e3efc1 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2025

  1. feat: Implement explicit session depth tracking in SessionContextHolder

    - Added TransactionalDepth enum to define transaction levels.
    - Enhanced SessionContextHolder with methods to manage session depth.
    - Updated @transactional decorator to utilize session depth for commit/rollback operations.
    - Introduced tests for session depth tracking and behavior in nested transactions.
    William-W-Chen committed Jun 20, 2025
    Configuration menu
    Copy the full SHA
    b22e3db View commit details
    Browse the repository at this point in the history
  2. 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.
    William-W-Chen committed Jun 20, 2025
    Configuration menu
    Copy the full SHA
    b95fe27 View commit details
    Browse the repository at this point in the history
  3. feat: Enhance CRUD repository with @transactional decorator for impro…

    …ved transaction management
    
    - Added @transactional decorator to multiple CRUD methods in CrudRepository to ensure proper transaction handling.
    - Updated commit logic in PySpringSession to warn against committing managed transactions.
    - Refactored clone method in PySpringModel to return the correct type.
    - Improved logging during session commit in PySpringModel for better clarity.
    - Introduced a method in SessionContextHolder to check if a transaction is managed.
    William-W-Chen committed Jun 20, 2025
    Configuration menu
    Copy the full SHA
    86e3562 View commit details
    Browse the repository at this point in the history
  4. feat: Enhance type safety in PySpringModel with TypeVar

    - Introduced TypeVar for PySpringModel to improve type hinting in the clone method.
    - Updated the clone method signature to return the correct type, enhancing clarity and type safety.
    William-W-Chen committed Jun 20, 2025
    Configuration menu
    Copy the full SHA
    9d31839 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bc2e6a0 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2025

  1. feat: Add versioning and export Query in PySpringModel

    - Introduced __version__ attribute to specify the current version of the package.
    - Updated __all__ to include Query for better module accessibility.
    William-W-Chen committed Jul 17, 2025
    Configuration menu
    Copy the full SHA
    4f59f86 View commit details
    Browse the repository at this point in the history
Loading