tag:blogger.com,1999:blog-4091582644082249460.post8037722274503908107..comments2023-08-01T04:32:41.615-05:00Comments on IT Happens Here!: How To Use Transaction Manager with @Transactional without getting 'org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here' Exception?Yet another Blogger!http://www.blogger.com/profile/08802949049819684281noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-4091582644082249460.post-26545667759552613652012-07-28T15:18:39.097-05:002012-07-28T15:18:39.097-05:00Thanx by zillions.Thanx by zillions.ezequielhttps://www.blogger.com/profile/11186123626527718733noreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-22544186628278975082011-10-11T22:42:07.986-05:002011-10-11T22:42:07.986-05:00Great post..
It helped me fix my problem but..
I...Great post..<br /><br />It helped me fix my problem but..<br /><br />I had error NoSuchBeanDefinationException for hibernateTransactionManager<br /><br /><br /> <br /><br /><br />and in <br /><br /><br />Then I changed the id to "transactionManager" and remove transaction-manager property from tx:annotation element. <br /><br />It started working. <br /><br />Then I changed it back to what it was and it is still working.<br /><br />Thanks any wayKrunalhttps://www.blogger.com/profile/13798738824030170859noreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-24577563467765426472011-04-30T04:13:46.408-05:002011-04-30T04:13:46.408-05:00Thanks a lot man... It will be really great if u c...Thanks a lot man... It will be really great if u could explain the attributes of the Transactional annotation with examples.. mail me when u r free... softwarevasanth@gmail.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-88339047870714786432011-02-12T08:48:53.584-06:002011-02-12T08:48:53.584-06:00Great post! I missed
xmlns:tx="http://www.spr...Great post! I missed<br />xmlns:tx="http://www.springframework.org/schema/tx"<br />in my config file. Thanks for help!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-34055215830778474662010-11-08T14:37:58.909-06:002010-11-08T14:37:58.909-06:00Hey akash, Thanks for letting me know about it!Hey akash, Thanks for letting me know about it!Yet another Blogger!https://www.blogger.com/profile/08802949049819684281noreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-62050679403455241042010-10-18T15:54:27.433-05:002010-10-18T15:54:27.433-05:00Thanks, you saved me a lot of time...Thanks, you saved me a lot of time...akashnoreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-16271087460505259712010-04-29T09:29:05.475-05:002010-04-29T09:29:05.475-05:00Hi Rico,
Yet another pointer to you from the rece...Hi Rico,<br /><br />Yet another pointer to you from the recent comment that you have posted. This is regarding the 2 points that you have modified. <br /><br />Regarding the first point, I understand that you have autowired the sessionFactory instead of the session as such!That should be fine<br /><br />But regarding the second pointer, I have a second thought. Actually the tag <tx: annotation -driven) should not be inserted in both the config files(appplicationContext and xxx-servlet.xml) - It should be moved to the applicationContext.xml which in turn gets loaded into the application by the contextLoaderListened. Its better that you dont introduce the txManager via the xxx-servlet.xml which is referred to as the webapplicationcontext of your application xxx.<br /><br />Let me know if you need more explanation on this!Yet another Blogger!https://www.blogger.com/profile/08802949049819684281noreply@blogger.comtag:blogger.com,1999:blog-4091582644082249460.post-52435665338966990772010-04-28T21:53:59.237-05:002010-04-28T21:53:59.237-05:00It's awesome, you are really helpful. After re...It's awesome, you are really helpful. After reading this article, I know I am on the right track. And finally find two silly bugs of my application. My application has similar design with the one your introduce, having Entities, DAO layer, service layer and controller layer. Service layer handling the transaction service which provided by Spring annotation. Controller will only call the services in service layer. <br /><br />Here are the two bugs I found in my codes:<br /><br />1. I made a silly mistake that let application get the hibernate current session when the application startup.<br /><br />In the class "GenericDAOImpl":<br />Before:<br /><br />protected Session session;<br />@Autowired<br />public void setSession(SessionFactory sessionFactory) {<br /> session = sessionFactory.getCurrentSession();<br />}<br /><br />After:<br />@Autowired<br />private SessionFactory sessionFactory;<br />public Session getSession() {<br /> return sessionFactory.getCurrentSession();<br />}<br /><br />2. I added the tag in both application-context.xml and XXX-servlet.xml files. And obviously, Spring use DispatcherServlet one.Ricohttps://www.blogger.com/profile/14751214126525048048noreply@blogger.com