drawbacks of using the same database instance during the application's lifecycle
181 views
Skip to first unread message
Ana
unread,
Sep 25, 2012, 11:31:42 AM9/25/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hyperg...@googlegroups.com
Hi,
I've read in the tutorial that'it is generally recommended to close a HyperGraph instance as soon as you're done with it'. However in my case it takes about 1.5s to create and close a database instance, and I can't afford to do it every time. That is why I'd like to know what are the drawbacks of using the same database instance as long as the application works?
Thanks,
Ana
Borislav Iordanov
unread,
Sep 25, 2012, 6:34:39 PM9/25/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hyperg...@googlegroups.com
The advice simply says that it's better for the application to have a
clean shutdown/exit process that closes the database, rather than
relying on the JVM shutdown hook. But if you need to re-open the
database multiple times, than by all means leave it open. The pattern
shouldn't be that you open and close the whole DB for every task or
transaction or whatever. There aren't any drawback of using the same
database instance. The only drawback is a potentially unclean shutdown
which could theoretically lead to some data loss, even though in
practice it has never happened.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hyperg...@googlegroups.com
We had that question before, added a little section "When to close,
when to leave open?" in the trivialtutorial. Formulation Ok?
Another question on that: is there some kind of sync command, maybe on
berkeley-side, such as the linux shell command forcing to write
changes to disk? Would be good to force persist changes, without the
need to shut down and reopen?
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hyperg...@googlegroups.com
Hi.
On 2012-09-26 00:56, Ingvar Bogdahn wrote:
> We had that question before, added a little section "When to close,
> when to leave open?" in the trivialtutorial. Formulation Ok?
Good point. I can add the question and Borislav answer to the tutorial.
But maybe a FAQ will be a better place for this.
Borislav Iordanov
unread,
Sep 29, 2012, 1:27:12 PM9/29/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hyperg...@googlegroups.com
Hi,
Yes, good idea. The FAQ is actually a wiki page as well, called
'QuestionsAndAnswers'. It is accessible if you click on
'Documentation' on hypergraphdb.org and then 'Questions and Answers'
on the right-hand mene.