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
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
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 received this message because you are subscribed to the Google Groups
> "HyperGraphDB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hypergraphdb/-/T2Ei0miG_i8J.
> To post to this group, send email to hyperg...@googlegroups.com.
> To unsubscribe from this group, send email to
> hypergraphdb...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hypergraphdb?hl=en.



--
http://www.kobrix.com, http://kobrix.blogspot.com,
http://sharegov.blogspot.com, http://ilovefencing.com

"Damn! The world is big!"

-- Heleni Daly

Ingvar Bogdahn

unread,
Sep 25, 2012, 6:56:48 PM9/25/12
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?

2012/9/26 Borislav Iordanov <borislav...@gmail.com>:

tiescher

unread,
Sep 29, 2012, 12:52:06 PM9/29/12
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
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.

Boris
Reply all
Reply to author
Forward
0 new messages