Ajay
12-05-2006, 08:12 PM
I am using declarative transaction in my application.
I have wrapped up object 'CreateMyCommand' with a transactional proxy using following configuration
<object id="CommandTxDefinition" type="Spring.Transaction.Interceptor.TransactionProxyFac toryObject, Spring.Data" lazy-init="true">
<property name="PlatformTransactionManager" ref="TransactionManager" />
<property name="TransactionAttributeSource" ref="TransactionAttributeSource" />
<property name="TransactionAttributes">
<name-values>
<add key="Execute*" value="PROPAGATION_REQUIRED" />
</name-values>
</property>
</object>
<object name="CreateMyCommand" parent="CommandTxDefinition">
<property name="target">
<object type="MyProject.Commands.CreateMyCommand, MyProject" singleton="false">
<property name="Dao" ref="Dao"/>
</object>
</property>
</object>
I would like to get prototype instance of 'CreateMyCommand' on every request.
I tried setting singleton="false" on "MyProject.Commands.CreateMyCommand" while setting target property.
But it always return Singleton instance of 'CreateMyCommand'.
Am I missing something here?
I have wrapped up object 'CreateMyCommand' with a transactional proxy using following configuration
<object id="CommandTxDefinition" type="Spring.Transaction.Interceptor.TransactionProxyFac toryObject, Spring.Data" lazy-init="true">
<property name="PlatformTransactionManager" ref="TransactionManager" />
<property name="TransactionAttributeSource" ref="TransactionAttributeSource" />
<property name="TransactionAttributes">
<name-values>
<add key="Execute*" value="PROPAGATION_REQUIRED" />
</name-values>
</property>
</object>
<object name="CreateMyCommand" parent="CommandTxDefinition">
<property name="target">
<object type="MyProject.Commands.CreateMyCommand, MyProject" singleton="false">
<property name="Dao" ref="Dao"/>
</object>
</property>
</object>
I would like to get prototype instance of 'CreateMyCommand' on every request.
I tried setting singleton="false" on "MyProject.Commands.CreateMyCommand" while setting target property.
But it always return Singleton instance of 'CreateMyCommand'.
Am I missing something here?