This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Spring Transaction issue  RSS feed

 
shiva shankar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am facing a peculiar problem in getting my prototype (non-singleton) service object, which is wrapped by the TransactionProxyFactoryBean. Even though I have declared my service object is not a singleton, the singleton transactionProxyFactoryBean provides the same service object for all requests.

Is it springs behavior?

<bean id="registryPurchaseServiceTrans" class="com.eg.RegistryPurchaseServiceImpl" singleton="false" autowire="byName">


<bean id="registryPurchaseService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
parent="transactionAwareService">
<property name="transactionManager" ref="transactionManager"/>
<property name="target" ref="registryPurchaseServiceTrans"/>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>

Any thoughts on resolving this will helpful.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Shivashankar"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!