-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: PythonSpring/pyspring-model
base: main
head repository: PythonSpring/pyspring-model
compare: feat/persistence-context
- 15 commits
- 14 files changed
- 1 contributor
Commits on Jun 19, 2025
-
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.
Configuration menu - View commit details
-
Copy full SHA for a7f4a65 - Browse repository at this point
Copy the full SHA a7f4a65View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 708906d - Browse repository at this point
Copy the full SHA 708906dView commit details -
Remove commented-out
PySpringModelRestController
from provider conf……iguration for clarity
Configuration menu - View commit details
-
Copy full SHA for 6e2631e - Browse repository at this point
Copy the full SHA 6e2631eView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 4699eaf - Browse repository at this point
Copy the full SHA 4699eafView commit details -
refactor: Rename variable
is_outermost
to `is_outermost_transaction……` for improving readability.
Configuration menu - View commit details
-
Copy full SHA for c79b134 - Browse repository at this point
Copy the full SHA c79b134View commit details -
feat: Introduce SessionController and session middleware for improved…
… session management
Configuration menu - View commit details
-
Copy full SHA for 7ce0e35 - Browse repository at this point
Copy the full SHA 7ce0e35View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 7c7cc55 - Browse repository at this point
Copy the full SHA 7c7cc55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e7b847 - Browse repository at this point
Copy the full SHA 4e7b847View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e3efc1 - Browse repository at this point
Copy the full SHA 8e3efc1View commit details
Commits on Jun 20, 2025
-
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.
Configuration menu - View commit details
-
Copy full SHA for b22e3db - Browse repository at this point
Copy the full SHA b22e3dbView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b95fe27 - Browse repository at this point
Copy the full SHA b95fe27View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 86e3562 - Browse repository at this point
Copy the full SHA 86e3562View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 9d31839 - Browse repository at this point
Copy the full SHA 9d31839View commit details -
feat: Improve type safety and fix variable naming in CRUD repository …
…and session context
Configuration menu - View commit details
-
Copy full SHA for bc2e6a0 - Browse repository at this point
Copy the full SHA bc2e6a0View commit details
Commits on Jul 17, 2025
-
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.
Configuration menu - View commit details
-
Copy full SHA for 4f59f86 - Browse repository at this point
Copy the full SHA 4f59f86View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...feat/persistence-context