Spring + JPA + Tomcat = Não persiste

Amigos, estou estudando a integração de Spring+JPA e estou tendo o seguinte problema:

servlet-context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/task"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">

    <mvc:annotation-driven/>

    <context:component-scan base-package="br.com.estudoSpringMVC.tarefas"/>

    <bean id="oracleDataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
        <property name="url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
        <property name="username" value="TAREFA"/>
        <property name="password" value="TAREFA"/>
    </bean>

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="oracleDataSource"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
        </property>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <tx:annotation-driven />

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="views/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
</beans>

persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">
    <persistence-unit name="tarefas" transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <class>br.com.estudoSpringMVC.tarefas.entidade.Tarefa</class>

        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
            <property name="hibernate.show_sql" value="true"/>
            <property name="hibernate.format_sql" value="true"/>
            <property name="hibernate.hbm2ddl.auto" value="update"/>
        </properties>
    </persistence-unit>
</persistence>

controller:

package br.com.estudoSpringMVC.tarefas.controller;

import br.com.estudoSpringMVC.tarefas.entidade.Tarefa;
import br.com.estudoSpringMVC.tarefas.hibernate.TarefaDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by IntelliJ IDEA.
 * Date: 03/07/13
 * Time: 14:35
 * To change this template use File | Settings | File Templates.
 */

@Transactional
@Controller
public class TarefasController {

    @Autowired
    private TarefaDao tarefaDao;

    @RequestMapping("novaTarefa")
    public String novaTarefa() {
        return "tarefa/formulario";
    }

    @RequestMapping("adicionarTarefa")
    public String inserir(Tarefa tarefa) {
        this.tarefaDao.inserir(tarefa);
        return "tarefa/tarefa-adicionada";
    }
}

dao:

package br.com.estudoSpringMVC.tarefas.hibernate;

import br.com.estudoSpringMVC.tarefas.entidade.Tarefa;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * Created by IntelliJ IDEA.
 * Date: 04/07/13
 * Time: 09:58
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class TarefaDao {
    @PersistenceContext
    private EntityManager manager;

    public void inserir(Tarefa tarefa) {
        manager.persist(tarefa);
    }
}

Estou usando Tocat 7. Quando faço o deploy e rodo a aplicação, se chamo o metodo inserir apenas recebo de msg no console o seguinte:

Hibernate: 
    select
        hibernate_sequence.nextval 
    from
        dual

E a persistencia não é feita no banco. Alguém poderia dar uma luz de resolver esse problema?

Todas as tentativas que realizei com Spring + JPA não me deram gerenciamento automático de transação.
Então, eu precisava fazer o commit ou rollback…

Antes de inserir você inicia uma transaction e depois faz commit.

Isso é justamente o que não quero fazer e o que o Spring diz fazer com a injeção de transações. Quero que o spring seja o responsável por gerenciar as transações, se ter que ficar abrindo, fechando, commitando, dando rollback, etc. Se for para eu fazer, não preciso ter o spring para a parte de persistência. Se eu coloco no dao qualquer comando que vá pegar uma transação (manager.getTransaction().begin(); por exemplo) tomo o seguinte erro:

Isso vai acontecer justamente pelo fato de eu já ter passado para o spring a tarefa de controlar o EntityManager e suas transações, não podendo assim eu querer realizar alguma ação da transação.

A anotação @Transactional na classe desconheço, eu uso no método.

Exemplo:

@RequestMapping("adicionarTarefa")  
@Transactional 
public String inserir(Tarefa tarefa) {

Eu tinha lido que colocando na classe vc coloca tds os métodos como Transactional. Mas mesmo colocando no método em específico continua sem funcionar.

Anota no método e passa um propagation como parâmetro:

[quote=AdrianoSB]A anotação @Transactional na classe desconheço, eu uso no método.

Exemplo:

@RequestMapping("adicionarTarefa") @Transactional public String inserir(Tarefa tarefa) { [/quote]

A annotation @Transactional também pode ser utilizada na classe.

Continua sem gravar no banco.

Faça a injeção do PersistenceContext na DAO por property:

@PersistenceContext public void setEntityManager(EntityManager em) { ... }

Consegui resolver. Vou deixar aqui as modificações que fiz caso alguém se depare com o mesmo problema. Alterei a tag no xml do spring.

estava assim:

<beans xmlns="http://www.springframework.org/schema/beans"  
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
       xmlns:mvc="http://www.springframework.org/schema/mvc"  
       xmlns:context="http://www.springframework.org/schema/context"  
       xmlns:tx="http://www.springframework.org/schema/task"  
       xsi:schemaLocation="http://www.springframework.org/schema/mvc 
                                      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd  
                                      http://www.springframework.org/schema/beans 
                                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
                                      http://www.springframework.org/schema/context 
                                      http://www.springframework.org/schema/context/spring-context-3.0.xsd 
                                      http://www.springframework.org/schema/task 
                                      http://www.springframework.org/schema/task/spring-task-3.0.xsd">

alterei as urls do serviço task, ficou assim:

<beans xmlns="http://www.springframework.org/schema/beans"  
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
       xmlns:mvc="http://www.springframework.org/schema/mvc"  
       xmlns:context="http://www.springframework.org/schema/context"  
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc 
                                      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd  
                                      http://www.springframework.org/schema/beans 
                                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
                                      http://www.springframework.org/schema/context 
                                      http://www.springframework.org/schema/context/spring-context-3.0.xsd 
                                      http://www.springframework.org/schema/tx
                                      http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

e alterei <tx:annotation-driven /> para <tx:annotation-driven transaction-manager="transactionManager"/>