Chris Donald wrote:Thank you for the reply.So when I remove the annotation @Transactional and have the transaction done manually,I was expecting it to work.But what I get is an exception.
.
What's the exception?
Chris Donald wrote:
The application which I am working on is a Spring-hibernate based webapp where I have a spring xml file which has all the information regarding datasource,session factory and transaction.
Also,if I have the @Transactional on and have the code on for manual transactions,will two separate transactions be created?
Thanks for your insight.
Never done it before. but I would expect that you Spring will call sessionCOntext.getCurrentSession to start/commit transaction, and if you use getCurrentSession to save then
you should be in the same transaction.
BTW, I have a hunch that your core problem is TheXYProblem. Why are you doing your own transaction management mixed with Transactional annotations?