-
FEATURED COMPONENTS
First time here? Check out the FAQ!
i have an application like
http://books.zkoss.org/wiki/Small_Talks/2006/July/ZK_with_Spring_DAO_and_JDBC_Part_II
all is work fine, but when update data, don't save on database.
i think is some problem for commit data.
thanks in advance...
queries work fine, the problem is with the update
no idea?
I solved half the problem, jdbcTemplate is working, but namedParameterJdbcTemplate is not working. below is my spring configuration:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/dsi</value> </property> </bean> <bean id="jdbcManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource"> <ref bean="dataSource"/> </property> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <constructor-arg> <ref bean="dataSource" /> </constructor-arg> </bean> <bean id="namedParameterJdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"> <constructor-arg> <ref bean="dataSource" /> </constructor-arg> </bean> <bean id="appTarget" class="app.gestor.QueryGestor"> <property name="jdbcTemplate"> <ref bean="jdbcTemplate" /> </property> <property name="namedParameterJdbcTemplate"> <ref bean="namedParameterJdbcTemplate" /> </property> </bean> <bean id="queryGestor" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="jdbcManager"/> </property> <property name="target"> <ref bean="appTarget"/> </property> <property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED</prop> <prop key="update*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED</prop> <prop key="delete*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED</prop> <prop key="find*">PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED, readOnly</prop> </props> </property> </bean>
I need my application to work both ways (with jdbcTemplate and namedParameterJdbcTemplate)
Asked: 2011-08-03 16:00:03 +0800
Seen: 750 times
Last updated: Aug 04 '11