一些有趣的嵌入式hsql [英] something funny with embedded hsql

查看:102
本文介绍了一些有趣的嵌入式hsql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是对某些东西感到好奇。我在项目中使用hsql(当然嵌入)。有一段时间,我觉得需要可视化生成的hibernate。我免费使用了dbvisualizer。这里是hsqljdbc.properties


jdbc.url = jdbc:hsqldb:file:mydb; create = true

hibernate hbm2ddl.auto = create


我下载了hsql 1.8.0_10。我做了所有必需的程序。我可以连接并查看表格,但在对表格做出的更改似乎不愿意显示。然后我试图删除数据库生成一个新的但仍然。你有在这方面的任何想法?



我通常是德比,但最近我意识到,关系管理并不是那么精确。我使用mysql的那一刻不利于开发所以我想知道,如果我忘了做什么或它只是为了表现这种方式。感谢阅读此解决方案

使用解决方案

使用新指南详细讨论了用于开发和测试的HSQLDB。

http://hsqldb.org/doc/2.0/guide/deployment-chapt.html#dec_app_dev_testing



HSQLDB默认使用写入延迟机制,并且版本1.8.x或0中的10秒后更改刷新到磁盘在版本2.0和更高版本中.5秒。



您可以强制关闭数据库并在上次连接关闭时写入所有更改:

  jdbc.url = jdbc:hsqldb:file:mydb; shutdown = true 

使用HSQLDB 2.x,您可以使用write_delay属性强制每个提交立即写入磁盘:

  jdbc.url = jdbc:hsqldb:file:mydb; hsqldb.write_delay = false 

版本2.2.9及更高版本在上次连接关闭时保留最新更改,因此可能不需要使用 hsqldb.write_delay = false 进行测试关闭连接。

使用HSQLDB 1.8,您需要在beginnig上运行SQL命令来执行此操作:



SET WRITE_DELAY FALSE


i'm just curious about something.I'm using hsql in myproject (embedded of course).At some time i felt the need to visualize what hibernate was generating.I took a free copy of dbvisualizer. here is the hsqljdbc.properties

jdbc.url=jdbc:hsqldb:file:mydb;create=true
hibernate hbm2ddl.auto=create

i downloaded the hsql 1.8.0_10. i did all the required procedure.i could connect and see the tables but after that changes made to the table don't seem be willing to show up.then i've tried to delete the db generate a new one but still.You got any idea in this?

I usually Derby but i've realized lately that it's not that precise about relationship management.I use mysql for the moment which is not good for development so i want to know if i forgot to do something or it's just meant to behave that way.Thanks for reading this

解决方案

Using HSQLDB for development and testing is discussed in detail in the new Guide.

http://hsqldb.org/doc/2.0/guide/deployment-chapt.html#dec_app_dev_testing

HSQLDB uses a write delay mechanism by default and changes are flushed to disk after 10 seconds in version 1.8.x or 0.5 sec in version 2.0 and later.

You can force the database to shutdown and write all the changes when the last connection is closed with this URL:

jdbc.url=jdbc:hsqldb:file:mydb;shutdown=true

With HSQLDB 2.x you can use the write_delay property to force each commit to write to disk immediately:

jdbc.url=jdbc:hsqldb:file:mydb;hsqldb.write_delay=false

Version 2.2.9 and later persist the latest changes when the last connection is closed, so it may not be necessary to use hsqldb.write_delay=false for tests that close the connections.

With HSQLDB 1.8, you need to run an SQL command at the beginnig to do this:

SET WRITE_DELAY FALSE

这篇关于一些有趣的嵌入式hsql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆