| Author |
Spring 2.5 @Transactional not working
|
Lisa Ray
Greenhorn
Joined: Mar 05, 2009
Posts: 22
|
|
Hi All,
I'm using annotation-based Spring 2.5 in my service layer. The service calls DAO. It seems that service is not wrapped in a transaction which causes the Hibernate DAO to fail.
My Configuration file looks like this:
Following is the Service impl class:
Please suggest in case I'm missing something here.
Thanks
Lisa
|
 |
Nathan Pruett
Bartender
Joined: Oct 18, 2000
Posts: 4121
|
|
|
Is that the only configuration file, or are there more? I don't see the '<tx:annotation-driven/>' in your configuration. Or a TransactionManager, or a DataSource defined.
|
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
|
 |
Lisa Ray
Greenhorn
Joined: Mar 05, 2009
Posts: 22
|
|
Hi Nathan, Thanks for the post. For the sake of brevity I didn't post the entire app context XML. Here's the Spring XML:
I'm sure that the beans have been wired correctly, else I would have got a fat parser error. The only concern is that the service layer is not wrapped in a transaction. Because of which I get the following exception from the DAO layer:
Thanks
Lisa
|
 |
Lisa Ray
Greenhorn
Joined: Mar 05, 2009
Posts: 22
|
|
Hi Ranchers,
I'm not sure if this is really a Spring issue or Hibernate ORM problem. I changed the transaction strategy to use AOP, as shown below:
Now even with the new changes in place, I get the following error:
- Lisa
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Spring 2.5 @Transactional not working
|
|
|