Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Anders Nawroth
Hi! Emil Eifrem: > On Tue, Dec 16, 2008 at 12:59 AM, Mwanji Ezana wrote: > > What does everyone else think? Is this something that should be > supported by the core API? (Do remember that our philosophy is to keep > the core API lean, clean and mean. Simplicity is a virtue and anything > that

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Emil Eifrem
On Tue, Dec 16, 2008 at 12:59 AM, Mwanji Ezana wrote: > Thanks again for all the help, things are going a lot faster. Happy to hear that! > > I was trying to come up with a better post-unit tests clean-up strategy than > "delete all Neo files" when I realised that a node can't be deleted if it >

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mwanji Ezana
Thanks again for all the help, things are going a lot faster. I was trying to come up with a better post-unit tests clean-up strategy than "delete all Neo files" when I realised that a node can't be deleted if it had relationships, but a relationship can always be deleted (please correct me if I'm

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mattias Persson
2008/12/15 Emil Eifrem : > On Mon, Dec 15, 2008 at 6:06 PM, Anders Nawroth > wrote: >> Then EmbeddedNeo could have a mechanism for registering services that it >> should shutdown before it finalizes itself? > > ... and we're quickly starting to grow into something we're not: a > service container.

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Emil Eifrem
On Mon, Dec 15, 2008 at 6:06 PM, Anders Nawroth wrote: > Then EmbeddedNeo could have a mechanism for registering services that it > should shutdown before it finalizes itself? ... and we're quickly starting to grow into something we're not: a service container. Let's leave that to the IoC guys. I

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Anders Nawroth
Mattias Persson skrev: > True, but if EmbeddedNeo adds a shutdown hook for itself and I'd like > to add my IndexService instance to that hook I couldn't and it won't > do to just add another shutdown hook which just shuts down the > IndexService because I have no control over the order those hooks

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Emil Eifrem
On Mon, Dec 15, 2008 at 3:49 PM, Mattias Persson wrote: > True, but if EmbeddedNeo adds a shutdown hook for itself and I'd like > to add my IndexService instance to that hook I couldn't and it won't > do to just add another shutdown hook which just shuts down the > IndexService because I have no c

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mattias Persson
True, but if EmbeddedNeo adds a shutdown hook for itself and I'd like to add my IndexService instance to that hook I couldn't and it won't do to just add another shutdown hook which just shuts down the IndexService because I have no control over the order those hooks are executed in. 2008/12/15 Em

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Emil Eifrem
On Mon, Dec 15, 2008 at 2:58 PM, Mattias Persson wrote: > It's a bad idea if you f.ex. have an IndexService which should be > shutdown before the NeoService... but that's an issue we'll solve with > events later on right? Right. And also, this would be a safe guard. The client would still be enco

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mattias Persson
2008/12/15 Emil Eifrem : > On Mon, Dec 15, 2008 at 2:28 PM, Mwanji Ezana wrote: >> Hi Mattias and Johan, >> >> Thanks for the tips. Actually, I didn't know about >> Runtime.addShutdownHook(), which is why I was having trouble and was >> shutting down on every transaction. >> >> I don't think that

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Emil Eifrem
On Mon, Dec 15, 2008 at 2:28 PM, Mwanji Ezana wrote: > Hi Mattias and Johan, > > Thanks for the tips. Actually, I didn't know about > Runtime.addShutdownHook(), which is why I was having trouble and was > shutting down on every transaction. > > I don't think that this is mentioned on the wiki anyw

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mwanji Ezana
Hi Mattias and Johan, Thanks for the tips. Actually, I didn't know about Runtime.addShutdownHook(), which is why I was having trouble and was shutting down on every transaction. I don't think that this is mentioned on the wiki anywhere. It would be nice to do so, since using addShutdownHook() mig

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Johan Svensson
Hi Mwanju, As Mattias pointed out the idea is to pass around the instantiated NeoService to the different parts of the application that needs it. All Neo API operations are thread safe and just needs to be executed in a transaction (and you can have concurrent transactions running). The startup a

Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mattias Persson
Hi Mwanji, It's generally not desirable to shut down and start up neo instances more than once in the lifecycle of a JVM instance. Maybe you're thinking of SQL connections where you see the new EmbeddedNeo(...) as getting an SQL connection. Neo doesn't work like that. It's normally the best idea t