使用spring实现hsqldb的持久性
我正在与spring和hsqldb的持久性作斗争。我检查了几个问题,但未能找到解决方案: 已签出的线程: 然而,到目前为止,这并没有起到任何作用。每次我重新启动我的Web服务器,所有的更改都消失了,没有任何内容写入我的硬盘 Hibernate配置如下使用spring实现hsqldb的持久性,spring,persistence,hsqldb,Spring,Persistence,Hsqldb,我正在与spring和hsqldb的持久性作斗争。我检查了几个问题,但未能找到解决方案: 已签出的线程: 然而,到目前为止,这并没有起到任何作用。每次我重新启动我的Web服务器,所有的更改都消失了,没有任何内容写入我的硬盘 Hibernate配置如下 @Bean public AnnotationSessionFactoryBean sessionFactoryBean() { Properties props = new Properties(); props.put("hi
@Bean
public AnnotationSessionFactoryBean sessionFactoryBean() {
Properties props = new Properties();
props.put("hibernate.dialect", HSQLDialect.class.getName());
props.put("hibernate.format_sql", "true");
props.put("hibernate.show_sql", "true");
props.put("hibernate.hbm2ddl.auto", "update");
props.put("hibernate.connection.url", "jdbc:hsqldb:file:c:\\temp\\rvec");
props.put("hibernate.connection.username", "sa");
props.put("hibernate.connection.password", "");
props.put("hibernate.connection.pool_size","1");
props.put("hibernate.connection.autocommit", "true");
AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
bean.setAnnotatedClasses(new Class[]{Course.class, User.class, Event.class});
bean.setHibernateProperties(props);
bean.setDataSource(this.dataSource);
bean.setSchemaUpdate(true);
return bean;
}
数据源和事务管理器在servlet-context.xml中配置
控制台中没有抛出错误,只有有效的sql语句。
有什么想法吗
亲切问候,,
Lomu可能是因为我在servlet上下文中使用了嵌入式数据源()是的,这是因为我在bean配置中配置了嵌入式数据源而不是“普通”数据源。多么愚蠢的错误:)
<tx:annotation-driven transaction-manager="transactionManager" />