Laurent,
the reference node does not _have_ to have a relationship, although it
is not recommended not to do so.

Another way to do this is to see if there are any relationships/nodes
in use. This is not the official API, but there is the possibility to
get a TransactionManager and the number of IDs in use:

EmbeddedNeo.getConfig().getNeoModule().getNodeManager().getNumberOfIdsInUse(Nodes.class)

This is not exposed in the external API and would require you , but it
might help you in your case. We are trying to get the Config API into
the 1.0 release, but don't count on it!

HTH

/peter neubauer

COO and Sales, Neo Technology

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org                - Relationships count.
http://www.linkedprocess.org   - Distributed computing on LinkedData scale



On Fri, Nov 20, 2009 at 1:56 PM, Laurent Laborde <[email protected]> wrote:
> Aditionnaly, i think that i found the easiest way to know if i run a
> new database for the first time :
> if(referenceNode.hasRelationship() == false) {
>     //we are running this database for the first time
>     //initialize stuff.
> }
>
> On Fri, Nov 20, 2009 at 1:13 PM, Mattias Persson
> <[email protected]> wrote:
>> Great, I'd be glad to answer more questions as they come along... and
>> enjoy your lunch!
>>
>> Best,
>> Mattias
>>
>> 2009/11/20 Laurent Laborde <[email protected]>:
>>> Thank you for your very fast replies.
>>> I will have more question, soon.
>>> But it's time to eat and i'll have some code to do before jumping to
>>> the next problem.
>>>
>>> --
>>> Ker2x
>>> sysadmin & DBA @ http://www.over-blog.com/
>>> _______________________________________________
>>> Neo mailing list
>>> [email protected]
>>> https://lists.neo4j.org/mailman/listinfo/user
>>>
>>
>>
>>
>> --
>> Mattias Persson, [[email protected]]
>> Neo Technology, www.neotechnology.com
>> _______________________________________________
>> Neo mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
>
>
> --
> F4FQM
> Kerunix Flan
> Laurent Laborde
> _______________________________________________
> Neo mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to