OLá rapaziada, estou com um problema, meu projeto utiliza JPA com hibernate gerenciado pelo Spring,
as vezes ao dra um select ou mesmo editar um campo e cancelar, ao invés de seleciona e/ou cancelar o sistema dar um update no banco ou até salva um novo no mesmo,
alguém pode me dizer o pq disto ocorrer?
segue meus arquivos de configuração:
SPRing-config
<?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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="
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.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<tx:annotation-driven transaction-manager="txManager"/>
<context:annotation-config />
<context:component-scan base-package="br.com.nome" />
<!-- Gerenciador de transacoes baseado em JPA -->
<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean id="persistentContextFactory"
class="org.apache.myfaces.orchestra.conversation.spring.JpaPersistenceContextFactory">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<!-- banco desenv -->
<bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="org.postgresql.Driver" />
<property name="jdbcUrl" value="jdbc:postgresql://localhost:5432/banco" />
<property name="user" value="124" />
<property name="password" value="123" />
<property name="initialPoolSize" value="20" />
<property name="minPoolSize" value="20" />
<property name="maxPoolSize" value="20" />
<property name="idleConnectionTestPeriod" value="500" />
<property name="acquireIncrement" value="1" />
<property name="maxStatements" value="1000" />
<property name="numHelperThreads" value="1" />
<property name="maxIdleTime" value="5"></property>
</bean>
<!-- Fabrica de entity managers -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="persistenceUnitName" value="troqueiAki" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
<property name="generateDdl" value="true" />
<property name="databasePlatform" value="org.hibernate.dialect.PostgreSQLDialect" />
</bean>
</property>
</bean>
<bean id="myAspect" class="br.com.nome"/>
<import resource="classpath:/META-INF/myview-spring-init.xml"/>
</beans>
persistence:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
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_1_0.xsd">
<persistence-unit name="nome" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<--classes-->
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.max_fetch_depth" value="2" />
<property name="hibernate.connection.pool_size" value="30" />
<property name="hibernate.c3p0.idle_test_period" value="40"></property>
<property name="hibernate.default_schema" value="public" />
<property name="hibernate.c3p0.timeout" value="60" />
<property name="hibernate.connection.release_mode" value="auto" />
<property name="hibernate.generate_statistics" value="true"></property>
<property name="hibernate.current_session_context_class" value="thread" />
<property name="hibernate.autocommit" value="false" />
</properties>
</persistence-unit>
</persistence>
se alguém poder ajudar