cancel
Showing results for 
Search instead for 
Did you mean: 

Is better Prototype scope for Neo4jRepository?

I used one interface that i defined @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) extends Neo4jRepository. Is It prototype scope good for Neo4jRepository ?

@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)*/
public interface ActivityCustomFieldRepository extends Neo4jRepository<ActivityCustomFieldNew, Long>

i used that above.

1 ACCEPTED SOLUTION

gerrit_meier
Neo4j
Neo4j

I don't see any benefit in using the prototype scope here. Beans of type Neo4jRepository should always be stateless and so can be defined and used as (standard) singleton beans.
In a prototype scenario you will end up with creating new repository beans for each call.

View solution in original post

1 REPLY 1

gerrit_meier
Neo4j
Neo4j

I don't see any benefit in using the prototype scope here. Beans of type Neo4jRepository should always be stateless and so can be defined and used as (standard) singleton beans.
In a prototype scenario you will end up with creating new repository beans for each call.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.