-
Jan 3rd, 2011, 12:23 AM
#1
Using singletone scope with BeanDefinitionBuilder can cause double calls to the init
Hi. I am using dynamic bean builder with BeanDefinitionBuilder.
I defined singleton as scope, but if a request to create the same bean was defined at the same time, 2 objects are created even though i defined a singleton. Why does this happen? How can i avoid this?
This is the definition i use:
<code>
BeanDefinitionBuilder dBuilder = BeanDefinitionBuilder.rootBeanDefinition(PriorityT askExecutor.class.getName());//UtilsClassPathes.TASK_EXEC_PRIORITY_QUEUE_CLASS_NA ME);
dBuilder.addPropertyValue("queueCapacity", 500);
dBuilder.setScope("singleton");// each matrix has one instance of this type
dBuilder.setLazyInit(true);
</code>
Thanks, Michal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules