用spring+hibernate写了个线程往数据库里插数据,但是发现有些数据无论怎么插 控制台的sql语句都有 也没有报错 但是数据库里就是没有这条数据 是什么问题呢?求大神解决,下面附上代码
application.xml
<context:component-scan base-package="daoImpl" />
<!-- 使用aop -->
<aop:aspectj-autoproxy />
<aop:config>
<aop:advisor pointcut="execution(* daoImpl.*.*(..))"
advice-ref="txAdvice" />
</aop:config>
<!--hibernate的事务处理管理 -->
<!-- -->
<tx:annotation-driven transaction-manager="transactionManager" />
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:myself"/>
<property name="username" value="root"/>
<property name="password" value="123"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.autocommit">true</prop>
<!-- <prop key="current_session_context_class">thread</prop> -->
<prop key="cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
</props>
</property>
public class test {
/**
* @param args
*/
@Test
public static void main(String[] args) {
// TODO Auto-generated method stub
File file = new File("D:\\done2220130901172241.txt");
ApplicationContext ac = new ClassPathXmlApplicationContext(