TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prakash Mondal
NA
288
209.1k
How to use transaction manager in Spring Framework?
Jul 5 2019 9:32 AM
In applicationContext.xml, I write this bellow code:
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="org.postgresql.Driver"
p:url="jdbc:postgresql://localhost:5432/SampleDB"
p:username="postgres"
p:password="Password" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref= "dataSource" />
</bean>
<bean id="registrationService" class = "com.test.Service.RegistrationService">
<property name="dataSource" ref="dataSource" />
</bean>
Controller Part:
ApplicationContext appctx = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getServletContext());
RegistrationService service = (RegistrationService) appctx.getBean("registrationService");
Service Part:
@Transactional(value = "transactionManager", rollbackFor=Exception.class)
But error occured.
Please help.
Any body can suggest me the another process.
Reply
Answers (
0
)
I have small doubt with jsp file, which is included in html
jsp simple uploader file