cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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

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

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.