Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Adding Synchronization and Locks via AspectJ #332

Open
zdenek-jonas opened this issue Nov 18, 2024 · 5 comments
Open

Feature Request: Adding Synchronization and Locks via AspectJ #332

zdenek-jonas opened this issue Nov 18, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@zdenek-jonas
Copy link
Contributor

Feature Request: Adding Synchronization and Locks via AspectJ

Description:
Introduce an additional module in the store that provides a synchronization mechanism similar to the one used in Spring through Spring AOP. Spring Mutex Locking Eclipse Store docs
This module would leverage AspectJ technology, which is known to function outside of the Spring ecosystem, as outlined in resources such as this Baeldung article.

Key Features:

  1. Optional Module: The module would be completely optional and isolated from the core functionality.
  2. AspectJ Integration: It would utilize AspectJ for implementing synchronization mechanisms for shared mutable graphs.
  3. Annotation-Based Control: Users willing to include AspectJ in their classpath and enable weaving would gain the ability to manage access to shared data elegantly using annotations.

This would offer a robust and streamlined solution for projects needing advanced synchronization without relying entirely on Spring.

    @Read
    public List<String> allJokes()
    {
    }
     

    @Write
    public Integer addNewJoke(String joke)
    {
    }
@zdenek-jonas zdenek-jonas added the enhancement New feature or request label Nov 18, 2024
@fh-ms
Copy link
Contributor

fh-ms commented Nov 19, 2024

The new concurrency helpers can be used for that.

eclipse-serializer/serializer#156

@rpx99
Copy link

rpx99 commented Nov 20, 2024

Is this feature meant to be a performance optimization for the synchronized keyword approach?

    public synchronized List<String> allJokes()
    {
    }
     
    public synchronized Integer addNewJoke(String joke)
    {
    }

@fh-ms
Copy link
Contributor

fh-ms commented Nov 20, 2024

It is meant to simplify the usage of ReentrantReadWriteLocks, which differentiate between read and write locks rather than just synchronizing.

@rpx99
Copy link

rpx99 commented Nov 20, 2024

Understand. But how can I do something like optimistic locking or versioning to avoid conflicts between different users?

@fh-ms
Copy link
Contributor

fh-ms commented Nov 21, 2024

This is an approach to pessimistic locking. Versioning can be done with Layered Entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants