Re: [Neo4j] IndexHits extends Iterable is evil

2011-12-20 Thread Jean-Pierre Bergamin
I created an issue for that: https://github.com/neo4j/community/issues/141

Best regards,
James
___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] IndexHits extends Iterable is evil

2011-12-09 Thread Jean-Pierre Bergamin
Dear neo4j community and developers

For the second time we stumbled about Iterables that are no Iterables
in Neo4j. IndexHits e.g. extends Iterator and Iterable and states in
its documentation that is not really an iterable but always returns
"this" in calls to iterator(). So far so good.

Now when using Spring Data Neo4j, the IndexHits is wrapped and hidden
behind ClosableIterable and IterableAdapter etc. The user has no idea
anymore that those IterableWrapper and ClosableIterable things he gets
back are no iterables at all - well the names tell him of course that
those things *are* Iterables. This leads to very, very strange
behaviour like this:

@Test
public void ouch() {
Device d1 = new Device("d1").persist();
Device d2 = new Device("d2").persist();

ClosableIterable devices = deviceRepository().findAll();
assertThat(devices, hasItems(d1));
assertEquals(1, IteratorUtil.count(devices));
}

We add two devices to our DB, but the test clearly states that
findAll() only returns one (assertEquals(1,
IteratorUtil.count(devices))).
As an exercise for the reader: explain why this test misleads you

Iterable should always return a valid iterator for every call to
iterator(). Implementing Iterable just to be able to use an iterator
in a for loop is evil. >:-)


Best regards,
James
___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] OSGi headers in 1.5 missing

2011-11-23 Thread Jean-Pierre Bergamin
Dear neo4j community

We're upgrading our project from Spring Data Graph 1.2 to Spring Data Neo4j
2.0, which requires neo4j 1.5.
I was shocked to find that all those valuable OSGi headers in the manifests
are gone in neo4j 1.5. But where? :-?

I hope they don't have been expelled definitively... :-o


Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Graph / Neo4j – Problems with OO Inheritance & Polymorphism relation semantics

2011-11-01 Thread Jean-Pierre Bergamin
2011/10/29 Agelos Pikoulas 

> Thank you Jean-Pierre/James for your answer - what you propose is certainly
> one valid way of doing it, but it is still doesnot feel like a 'natural'
> way
> : It doesn't allow the dynamic 'navigation' of bean properties that are
> them
> selves Collections that each entry might have other Collections etc.
> For instance I might have a User which has a getFollowers() or
> getLikedObjects() etc and I want to display some of their stuff, following
> some display logic etc :-) Perhaps this wouldn't be the most elegant way
> MVC
> wise, but I am not a spring/jsp/mvc expert anyway.
>

I just remembered that there is an iterator() method on collections in some
newer servlet implementations (maybe a servlet 3 spec?). So this is
possible:


  


We are using tomcat 7 (inside Virgo 3) and it works.


Best regards,
James

Surelly this isn't SDN's fault, but JSP's. It would though be very helpful
> (and perhaps its a twoliner) if we could annotate @Query on more (immutable
> or not) Collection/iteration interfaces, say Iterator for a start
>
> Regards
>
> On Thu, Oct 27, 2011 at 10:01 PM, Jean-Pierre Bergamin <
> jpberga...@gmail.com
> > wrote:
>
> > Hi Agelos
> >
> > Regarding your 2nd point:
> >
> > 2)  2) The minor issue I have regards (the otherwise brilliant)
> @Query,
> > > due to its constraint of annotating (mainly) Iterable and NOT allowing
> > Set,
> > > List etc (a runtime exception is thrown
> > > org.springframework.data.neo4j.conversion.QueryResultBuilder$1 cannot
> be
> > > cast to java.util.List).
> > >
> > > This wouldn’t be a huge problem, but the JSP/JSLT  tag DOESNOT
> > > iterate Iterable (!!!), nor you can directly call .iterator() from
> within
> > > JSP, making life hard on both ends.
> > >
> >
> > From the controller, just pass the iterator of the iterable to your JSP.
> > With Spring MVC, this would look like:
> >
> >@RequestMapping(method = RequestMethod.GET)
> >public String list(Model uiModel) {
> >uiModel.addAttribute("kpis", kpiRepository.findAll().iterator());
> >return "secure/kpis/list";
> >}
> >
> > In your JSP, you then can use this iterator as expected:
> >
> > 
> > 
> > 
> > 
> > 
> > 
> >
> >
> > Best regards,
> > James
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Graph / Neo4j – Problems with OO Inheritance & Polymorphism relation semantics

2011-10-27 Thread Jean-Pierre Bergamin
Hi Agelos

Regarding your 2nd point:

2)  2) The minor issue I have regards (the otherwise brilliant) @Query,
> due to its constraint of annotating (mainly) Iterable and NOT allowing Set,
> List etc (a runtime exception is thrown
> org.springframework.data.neo4j.conversion.QueryResultBuilder$1 cannot be
> cast to java.util.List).
>
> This wouldn’t be a huge problem, but the JSP/JSLT  tag DOESNOT
> iterate Iterable (!!!), nor you can directly call .iterator() from within
> JSP, making life hard on both ends.
>

>From the controller, just pass the iterator of the iterable to your JSP.
With Spring MVC, this would look like:

@RequestMapping(method = RequestMethod.GET)
public String list(Model uiModel) {
uiModel.addAttribute("kpis", kpiRepository.findAll().iterator());
return "secure/kpis/list";
}

In your JSP, you then can use this iterator as expected:









Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Jobangebot in Zürich/Wallisellen als Java-Entwickler mit Neo4j-Kenntnissen

2011-10-12 Thread Jean-Pierre Bergamin
Liebe Graphistas

Ich möchte bekennende Graph-DB-Enthusiasten auf unsere offene Stelle
aufmerksam machen:
Wir suchen einen Java-Entwickler, der Teil unseres Scrum-Teams werden
will. Unsere BSM-Software basiert auf Spring und ist modular mit OSGI
(Spring Dynamic Modules) aufgebaut. Als Applikationsserver kommt Virgo
zum Einsatz. Die Webapplikation wird mit Spring MVC und JSP/JSTL und
mit Dojo als Javascript-Framework umgesetzt. Für die Kommunikation
zwischen den Systemen wird JMS mit Camel verwendet.

Als Datenbank und sozusagen als Herzstück setzen wir - wie könnte es
auch anders sein - neo4j embedded mit Spring Data Neo4j ein. Für die
Speicherung von Messdaten (Mrd. von Werten) wird voraussichtlich
MongoDB verwendet.

Wer sich in einem agilen Team wohlfühlt und bereit ist, sich in einen
leading-edge Technologie-Stack einzuarbeiten soll sich melden.

Unter http://www.junisphere.net/docs/Software_Entwicklungsingenieur.pdf
sind weitere Informationen zum Jobangebot zu finden. Unsere Büros sind
im Glattzentrum in Wallisellen (in der Nähe von Zürich).

Wir freuen uns auf Bewerbungen von echten Graphistas! :-)
Bewerbungen sind an Lindita Eichmann (leichm...@junisphere.net) zu richten.


Viele Grüsse
Jean-Pierre Bergamin

PS: German is a must. This is why this post is written in German... ;-)

-- 
Junisphere Systems AG
Glatt Tower
P.O. Box 1572
CH-8301 Glattzentrum

Phone  +41 43 443 31 80
Direct +41 43 443 31 93
jpberga...@junisphere.net
www.junisphere.net
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Neo4j 2.0 Roadmap

2011-10-06 Thread Jean-Pierre Bergamin
> One way of handling different types of "use-cases" per node is to use 
> projection. So per context you have different types with attributes and 
> behaviour that is just relevant for the context.

I have to admit that I never worked with projection so far. The
problem with the projection approach is IMHO the fact that I normally
cannot project an entity to another type because I don't know the end
type. When as in our example a traversal follows all HAS_FLOW_TO
relationships (Service 1 --> Device 1 --> Service 2), all visited
nodes are of some common base type/interface. The actual type is not
known in advance and the actually visited node therefore cannot be
projected to the concrete (unknown) type. This of course can be
overcome by using instanceof constructs, but as an OO disciple you
won't dare... :-)

> Regarding your use of interfaces, of course we could support using interfaces 
> as target types for relationships and start/end nodes, implementation wise it 
> would either be dynamic proxies, cglib or some AJ magic.
>
> The only issue I see here is that besides getters/setters for the attributes 
> you would also want to have actual implementation / behaviour that would have 
> been implemented somewhere (and then delegated to). E.g. in a inner class of 
> the interface which is then initialized with the concrete instance of the 
> node-backed interface(s) implementations. Had some interesting discussions 
> with Oliver Gierke from VMware how one could use generics and the "&" 
> operator to define interface mixin composition. But the interface stuff won't 
> be in there for 2.0.

We currently have the common implementation for all our entities in a
static utility class (ouch). The entity classes itself (e.g. class
Device) implement all methods from all interfaces itself, but delegate
to the utility class, passing "this" as an argument to the methods.
NodeBacked methods like "relateTo" are then executing on that "this"
reference. Not very comfortable, but it's something we at least can
share common implementation.

> Regarding Nodebacked - as the core changed to work on just annotated entities 
> without any AJ I changed the target type of almost all operations to be just 
> "Object", It could be that some of the methods would benefit from generics, 
> didn't look through that.
>
> Regarding your editor/POJO - that would be solved by the fetch/load strategy 
> on load or detach and by the save operation. Those entities should then also 
> be serializable so that they are no longer actively connected in the graph.
That's great news. So we hope to get rid of our in-memory implementations again.

> A question - is your meta-model also stored in the graph? If you there could 
> be interesting relationships between elements of the model and meta-model to 
> be explored.

No. Our Meta-Model is not stored anywhere, but in code. But I really
would like to see the definition of such a meta model "somewhere".

> Regarding the specification of subgraph models. I agree a interface based 
> approach would be interesting. OTOH  having a DSL for defining those 
> subgraphs would probably be even more compelling. After all you should be 
> able to transform the one into the other and vice versa. That's something 
> where .net's LINQ and the dynamic types derived from such a query shine.
>
> For "dynamic" content you would have (as you did) either implement 
> field-acessors to store them fine grained in the graph for further processing 
> or just provide a Spring Converter that converts your documents into json 
> structures which would be stored as strings. There are plans to support such 
> structures natively in Neo4j but no definitive planning for those features.
>
> Regarding the traversals and converting entity path, there is a Evaluator 
> that provides you with an EntityPath. But your're right, the GDC should be 
> passed in, can you create a JIRA item for that?
Please see DATAGRAPH-116

> I tried to document all the user facing parts of the API, so if there's 
> something missing please let me know. You can also ping me on skype.
>
> Regarding loading stragegies. #1 and #2 will be there, for the others there 
> won't be enough time before SpringOne. I also like #6, probably with the 
> interface base graph definition it will be less effort to define them.
Having #1 and #2 with POJOs already would be beneficial for us.


Best regards
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Neo4j 2.0 Roadmap

2011-10-05 Thread Jean-Pierre Bergamin
Hello everyone

I'm really glad to see that SDG or SDN (as it will be called on from
now on) is actively maintained and that new ideas are followed to
solve the day to day "problems" when working with graphs. I'm not
really sad to hear that the AspectJ mapping will not be in main focus
for the future. Working with AspectJ can be really cumbersome and
error prone. And I personally don't like the active record pattern for
enterprise applications anyway, because it ties the database state
directly to your domain object. But this may be a matter of taste
also...

Interestingly enough we just had many internal discussions these days
how to model our domain and how spring data neo4j will be used to
implement it. Let me describe the challenges we have/had while working
with Neo4j and SDN:

"Multiple inheritance"
--
Our domain model is quite complex and entities can play many different
roles in a graph and therefore they can have many different
relationships to many other entities of different types. Some entity
types can be the starting- *and* end-point of some relationships,
whereas other types only can be a start- *or* end-point for certain
relationships and so on. Let me show a very, very simplified example:

Having three entity types Service, Device and Process (among many
others), there are the following valid relationships:
(Service)---[DEPENDS_ON]--->(Service)
(Service)---[DEPENDS_ON]--->(Device)
(Process)---[DEPENDS_ON]--->(Service)

(Service)---[HAS_FLOW_TO]--->(Service)
(Service)---[HAS_FLOW_TO]--->(Device)
(Device)---[HAS_FLOW_TO]--->(Service)
(Device)---[HAS_FLOW_TO]--->(Device)

Such a model is unrepresentable with a class hierarchy in Java's
single inheritance approach. Classes in such a tree like hierarchy
cannot take so many different roles. It requires interfaces to model
the various roles an entity can play. The entity class can then
implement many interfaces as roles (~ "multiple inheritance").

We ended up defining one interface per start- and one per end-node for
each relationship (role):
(IDepender)---[DEPENDS_ON]--->(IDependee)
(IDataProvider)---[HAS_FLOW_TO]--->(IDataConsumer)

The interface define the allowed operations:

interface IDepender {
DependsOnRelationship dependsOn(IDependee dependee);
}

The actual entity interface we use in client code then extends all
these interfaces (roles).

interface IService extends IDepender, IDependee, IDataProvider, IDataConsumer
interface IDevice extends IDependee, IDataProvider, IDataConsumer
interface IProcess extends IDepender

The node entity classes then implements this entity interface.

@NodeEntity class Service implements IService { ... }
@NodeEntity class Device implements IDevice { ... }
@NodeEntity class Process implements IProcess { ... }


This works quite well, but does not fit very well into the SDN
concept. How would i.e. the DEPENDS_ON Relationship be declared?
Maybe...

@RelationshipEntity
class DependsOnRelationship {
@StartNode
private IDepender start;
@EndNode
private IDependee end;
}

This unfortunately is not possible, because concrete NodeBacked
classes are expected as @StartNode and @EndNode here. Since there is
no way to define base classes for all the start- and end-points for
all relationships in a complex model, it becomes impossible to have a
type-safe declaration here. We ended up defining a common base class
for all entities (class BaseEntity) and use this when SDN is requiring
a NodeBacked class:

@NodeEntity class BaseEntity {}
@NodeEntity class Service extends BaseEntity implements IService { ... }
...

@RelationshipEntity
class DependsOnRelationship {
@StartNode
private BaseEntity start;
@EndNode
private BaseEntity end;

public IDepender start() { return (IDepender)start; }
public IDependee end() { return (IDependee)end; }
}

But this is not strictly type safe and does not "describe" what the
start and endpoint of a DependsOnRelationship can be.

Pojos
-
We have a graphical editor that allows the user to design a data flow
graphically. The editor has its own model to read and store this "flow
model" the user is drawing. When a flow model is loaded, we have to
extract a sub-graph from the neo4j DB and convert it to the editor's
format. When the user saves the flow model, we convert it back,
compare it with the DB and save the changes. What sounds really simple
is actually quite complex. Because the @NodeEntity classes are no
POJOs but directly wired to the DB, we cannot use them to store an in
memory representation of the flow model we get from the editor for
further comparison with the DB. We had to introduce POJO
implementations for all our entity types. So it would be very helpful
to have POJOs as entity types so that they also can "live" without a
database representation.

Subgraphs/use-cases/schema
-
As you mentioned in your possible loading strategies, it would

Re: [Neo4j] Meet-up in Zurich

2011-10-05 Thread Jean-Pierre Bergamin
2011/10/4 Andreas Kollegger :
> Or, with an umlaut...
Cool. :-)
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Meet-up in Zurich

2011-10-04 Thread Jean-Pierre Bergamin
> let's do a meetup group like http://www.meetup.com/Neo4j-Oresund/ ?

I created a meetup group and added the first event:
http://www.meetup.com/Neo4j-Zurich/events/36063832/

Feel free to join the group. There will hopefully follow a lot of
other meet-ups and events. :-)


Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Meet-up in Zurich

2011-10-04 Thread Jean-Pierre Bergamin
Hi Daniel
> I’ll try to stop by. My friend and I built a startup using Neo4j and we’ve
> had a great experience so far. Is there RSVP list?

Just stop by. There is no RSVP.

Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Meet-up in Zurich

2011-09-29 Thread Jean-Pierre Bergamin
Dear Graphistas

Please join us for the first, spontaneous neo4j meet-up in Zurich on next
Thursday 6/10. We meet at 17:00 in the Johanniter in the Niederdorf, drink a
beer or two and exchange experiences with Neo4j.

See you
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] OSGi and Neo4j - superbundle approach

2011-07-26 Thread Jean-Pierre Bergamin
BTW: When I try to install the bundle
org.neo4j.examples.osgi:test-bundle on virgo I also get the lucene
error, although I have deployed the patched neo4j 1.5-SNAPSHOT bundles
to the repository/usr of Virgo.

It seems as if the test-bundle has the correct manifest and I can
verify that Virgo provides the imported packages, e.g. with "clhas
org.neo4j.graphdb.index.IndexProvider".

Best regards,
James

2011/7/26 Jean-Pierre Bergamin :
> Helly everyone
>
> I'm currently also stuck with the "No index provider 'lucene' found"
> error that you all seem to have been able to work around.
> I have built and installed the 1.5-SNAPSHOT kernel from the
> bundle-friendly-classloader branch and installed it locally (mvn
> install).
> When I run the neo4j-osgi tests I still get the mentioned lucene error:
>
> ...
> [FelixDispatchQueue] DEBUG org.neo4j.examples.osgi.test-bundle -
> BundleEvent STOPPED
> ERROR: Bundle org.neo4j.examples.osgi.test-bundle [3] Error starting
> file:bundles/org.neo4j.examples.osgi.test-bundle_0.1.0.SNAPSHOT.jar
> (org.osgi.framework.BundleException: Activator start error in bundle
> org.neo4j.examples.osgi.test-bundle [3].)
> java.lang.IllegalArgumentException: No index provider 'lucene' found
>        at 
> org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:76)
> ...
>
> Failed tests:
>  neo4jStartupTest(org.neo4j.examples.osgi.OSGiTest)
>  bundleStartupTest(org.neo4j.examples.osgi.OSGiTest)
>
> Is there anything else I have to to so that I get the examples up and running?
>
>
> Best regards,
> James
>
>
> 2011/7/26 Nicolas Jouanin :
>> Glad to hear that !
>>
>> 2011/7/25 Jörg Richter 
>>
>>>
>>> Hi Peter,
>>>
>>> SUCCESS!!!
>>>
>>> "No index provider 'lucene' found" in OSGi is solved for the moment!
>>>
>>> Its exactly as you suggest:
>>> When using pax exam's native container no error shows up.
>>> When using pax exam's pax runner container the error shows up (which is
>>> correct OSGi behavoir).
>>> When using bundle-friendly-classloader branch of neo 1.5-SNAPSHOT kernel
>>> the error disappears!
>>> My neo4j-osgi-test project runs successful now!
>>>
>>> I'm looking forward to have a patch like yours in the next neo4j stable.
>>>
>>> Thank you and Toni very much for investigation.
>>>
>>> Cheers,
>>> Jörg
>>>
>>>
>>> On Jul 24, 2011, at 22:08, Peter Neubauer wrote:
>>>
>>> > Jörg,
>>> > there where several issues Toni and me found when looking at your
>>> > example. Thanks a lot!
>>> >
>>> > First of all, Pax Exam Player using the built-in native OSGi Runner is
>>> > not emulating the real platform classloading correctly. Toni is at
>>> > this one, the tests are switched to the PaxRunner instead, running in
>>> > its own process.
>>> >
>>> > Secondly, the Neo4j Service.java that is loading the classes and
>>> > resources is not providing a classloader, which in an OSGi bundle
>>> > defaults to a classloader that does not find the interesting classes
>>> > and services. With
>>> >
>>> > private static  Iterable java6Loader( Class type )
>>> >    {
>>> >        try
>>> >        {
>>> >            @SuppressWarnings( "unchecked" ) Iterable result =
>>> (Iterable)
>>> >                    Class.forName( "java.util.ServiceLoader" )
>>> >                    .getMethod( "load", Class.class, ClassLoader.class )
>>> >                    .invoke( null, type, Service.class.getClassLoader() );
>>> >            return filterExceptions( result );
>>> >        }
>>> >        catch ( Exception e )
>>> >        {
>>> >            return null;
>>> >        }
>>> >        catch ( LinkageError e )
>>> >        {
>>> >            return null;
>>> >        }
>>> >    }
>>> >
>>> > Everything works, but we need to discuss more what classloader to
>>> > chose in what contexts, as this might not be great in all
>>> > circumstances.
>>> >
>>> > Anyway, you can build the fixed kernel project from
>>> > https://github.com/neo4j/community/tree/bundle-friendly-classloader,
>>> > then build the https://github.com/neo4j/neo4j-osgi and you should be
>>> > able to start up your test project (see my pull request).
>>> >
>>> > Let me know if that works!
>>> >
>>> > /peter
>>>
>>> ___
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>>>
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] OSGi and Neo4j - superbundle approach

2011-07-26 Thread Jean-Pierre Bergamin
Helly everyone

I'm currently also stuck with the "No index provider 'lucene' found"
error that you all seem to have been able to work around.
I have built and installed the 1.5-SNAPSHOT kernel from the
bundle-friendly-classloader branch and installed it locally (mvn
install).
When I run the neo4j-osgi tests I still get the mentioned lucene error:

...
[FelixDispatchQueue] DEBUG org.neo4j.examples.osgi.test-bundle -
BundleEvent STOPPED
ERROR: Bundle org.neo4j.examples.osgi.test-bundle [3] Error starting
file:bundles/org.neo4j.examples.osgi.test-bundle_0.1.0.SNAPSHOT.jar
(org.osgi.framework.BundleException: Activator start error in bundle
org.neo4j.examples.osgi.test-bundle [3].)
java.lang.IllegalArgumentException: No index provider 'lucene' found
at 
org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:76)
...

Failed tests:
  neo4jStartupTest(org.neo4j.examples.osgi.OSGiTest)
  bundleStartupTest(org.neo4j.examples.osgi.OSGiTest)

Is there anything else I have to to so that I get the examples up and running?


Best regards,
James


2011/7/26 Nicolas Jouanin :
> Glad to hear that !
>
> 2011/7/25 Jörg Richter 
>
>>
>> Hi Peter,
>>
>> SUCCESS!!!
>>
>> "No index provider 'lucene' found" in OSGi is solved for the moment!
>>
>> Its exactly as you suggest:
>> When using pax exam's native container no error shows up.
>> When using pax exam's pax runner container the error shows up (which is
>> correct OSGi behavoir).
>> When using bundle-friendly-classloader branch of neo 1.5-SNAPSHOT kernel
>> the error disappears!
>> My neo4j-osgi-test project runs successful now!
>>
>> I'm looking forward to have a patch like yours in the next neo4j stable.
>>
>> Thank you and Toni very much for investigation.
>>
>> Cheers,
>> Jörg
>>
>>
>> On Jul 24, 2011, at 22:08, Peter Neubauer wrote:
>>
>> > Jörg,
>> > there where several issues Toni and me found when looking at your
>> > example. Thanks a lot!
>> >
>> > First of all, Pax Exam Player using the built-in native OSGi Runner is
>> > not emulating the real platform classloading correctly. Toni is at
>> > this one, the tests are switched to the PaxRunner instead, running in
>> > its own process.
>> >
>> > Secondly, the Neo4j Service.java that is loading the classes and
>> > resources is not providing a classloader, which in an OSGi bundle
>> > defaults to a classloader that does not find the interesting classes
>> > and services. With
>> >
>> > private static  Iterable java6Loader( Class type )
>> >    {
>> >        try
>> >        {
>> >            @SuppressWarnings( "unchecked" ) Iterable result =
>> (Iterable)
>> >                    Class.forName( "java.util.ServiceLoader" )
>> >                    .getMethod( "load", Class.class, ClassLoader.class )
>> >                    .invoke( null, type, Service.class.getClassLoader() );
>> >            return filterExceptions( result );
>> >        }
>> >        catch ( Exception e )
>> >        {
>> >            return null;
>> >        }
>> >        catch ( LinkageError e )
>> >        {
>> >            return null;
>> >        }
>> >    }
>> >
>> > Everything works, but we need to discuss more what classloader to
>> > chose in what contexts, as this might not be great in all
>> > circumstances.
>> >
>> > Anyway, you can build the fixed kernel project from
>> > https://github.com/neo4j/community/tree/bundle-friendly-classloader,
>> > then build the https://github.com/neo4j/neo4j-osgi and you should be
>> > able to start up your test project (see my pull request).
>> >
>> > Let me know if that works!
>> >
>> > /peter
>>
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] OSGi and Neo4j - superbundle approach

2011-07-21 Thread Jean-Pierre Bergamin
Thank you. It worked with "mvn -u clean install".

Best regards,
James

2011/7/21 Peter Neubauer :
> So,
> now, with another merge from Toni, you should be able to build
> https://github.com/neo4j/neo4j-osgi with just
>
> mvn clean install
>
> Enjoy!
>
> Cheers,
>
> /peter neubauer
>
> 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               - Your high performance graph database.
> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Thu, Jul 21, 2011 at 12:05 AM, Toni Menzel  wrote:
>> btw, sorry about the Tinybundles disruption. The group id "org.ops4j.pax"
>> was actually wrong since ripping out tinybundles from pax swissbox.
>> Actually there will be just one tinybundles artifact and it will carry 1.0
>> really soon.
>>
>> Until then you may grab latest artifacts from
>> https://oss.sonatype.org/content/groups/ops4j/ .
>>
>>
>> On Thu, Jul 21, 2011 at 12:00 AM, Peter Neubauer
>>  wrote:
>>>
>>> And, there was a bug in Pax Exam not shutting down the bundles
>>> properly. Fixed by Toni Menzel in 5 minutes. Thanks!
>>>
>>> I added some build instructions to https://github.com/neo4j/neo4j-osgi
>>> to get things working. Give it a try!
>>>
>>> Cheers,
>>>
>>> /peter neubauer
>>>
>>> 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               - Your high performance graph database.
>>> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
>>> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>>>
>>>
>>>
>>> On Wed, Jul 20, 2011 at 11:12 PM, Peter Neubauer
>>>  wrote:
>>> > Ahh,
>>> > sorry, seems Tinybundles changes groupId and API since my last pull.
>>> > Pushed the updates. Please try again :)
>>> >
>>> > Cheers,
>>> >
>>> > /peter neubauer
>>> >
>>> > 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               - Your high performance graph
>>> > database.
>>> > http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
>>> > http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>>> >
>>> >
>>> >
>>> > On Wed, Jul 20, 2011 at 9:39 PM, Jean-Pierre Bergamin
>>> >  wrote:
>>> >> Hi Peter
>>> >>
>>> >> When I ran mvn install, I got:
>>> >> ...
>>> >> [WARNING] Warning building bundle
>>> >> org.ops4j.pax.tinybundles:tinybundles:bundle:1.0.0-SNAPSHOT
>>> >> ...
>>> >> [INFO] Installing
>>> >>
>>> >> org/ops4j/pax/tinybundles/tinybundles/1.0.0-SNAPSHOT/tinybundles-1.0.0-SNAPSHOT.jar
>>> >>
>>> >> I think there is a "tinybundles" to much in between. :-)
>>> >>
>>> >> I moved the 1.0.0-SNAPSHOT folder one level up in the .m2/repository
>>> >> folder structue and at least the tinybundles jar can now be found in
>>> >> the neo4j-osgi projects.
>>> >>
>>> >> I now have compilation errors in the examples project:
>>> >> [ERROR] Failed to execute goal
>>> >> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
>>> >> (default-testCompile) on project neo4j-osgi-examples: Compilatio
>>> >> n failure: Compilation failure:
>>> >> [ERROR]
>>> >> \Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[35,46]
>>> >> package org.ops4j.pax.tinybundles.core.builders does not exist
>>> >> [ERROR]
>>> >> \Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\exampl

Re: [Neo4j] OSGi and Neo4j - superbundle approach

2011-07-20 Thread Jean-Pierre Bergamin
Hi Peter

When I ran mvn install, I got:
...
[WARNING] Warning building bundle
org.ops4j.pax.tinybundles:tinybundles:bundle:1.0.0-SNAPSHOT
...
[INFO] Installing
org/ops4j/pax/tinybundles/tinybundles/1.0.0-SNAPSHOT/tinybundles-1.0.0-SNAPSHOT.jar

I think there is a "tinybundles" to much in between. :-)

I moved the 1.0.0-SNAPSHOT folder one level up in the .m2/repository
folder structue and at least the tinybundles jar can now be found in
the neo4j-osgi projects.

I now have compilation errors in the examples project:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
(default-testCompile) on project neo4j-osgi-examples: Compilatio
n failure: Compilation failure:
[ERROR] 
\Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[35,46]
package org.ops4j.pax.tinybundles.core.builders does not exist
[ERROR] 
\Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[36,46]
package org.ops4j.pax.tinybundles.core.builders does not exist
[ERROR] 
\Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[35,46]
package org.ops4j.pax.tinybundles.core.builders does not exist
[ERROR] 
\Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[36,46]
package org.ops4j.pax.tinybundles.core.builders does not exist
[ERROR] 
\Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[57,39]
cannot find symbol
[ERROR] symbol  : class BndBuilder
[ERROR] location: class org.neo4j.examples.osgi.OSGiTest
[ERROR] 
\Users\james\Documents\Development\neo4j-osgi\examples\src\test\java\org\neo4j\examples\osgi\OSGiTest.java:[57,55]
cannot find symbol
[ERROR] symbol  : class SynchronousRawBuilder
[ERROR] location: class org.neo4j.examples.osgi.OSGiTest

And indeed, the org.ops4j.pax.tinybundles.core.builders package is not
in the tinybundles jar I just built and installed, but only
..tinybundles.core and ..tinybundles.core.intern. Any ideas?


Best regards,
James

2011/7/20 Peter Neubauer :
> Hi Jean-Pierre,
> sorry for the inconvenience, the Tinybundles version is not yet
> released by the OPS4J team, so you can build it yourself from
>
> https://github.com/ops4j/org.ops4j.pax.tinybundles
>
> with
>
> mvn clean install
>
> Feedback is appreciated!
>
> Cheers,
>
> /peter neubauer
>
> 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               - Your high performance graph database.
> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Wed, Jul 20, 2011 at 9:12 PM, Jean-Pierre Bergamin
>  wrote:
>> Hello everyone
>>
>> May I chime in here...
>>
>> We are really interested to see neo4j working in an OSGi environment
>> esp. together with Spring Data Graph. After an unsuccessful attempt to
>> get it up and running a couple of weeks ago we gave it another chance
>> today after seeing this post and after a whole day of debugging and
>> fiddling around with manifests and template.mf and osgi.bnd we have  -
>> hurray - a running neo4j and Spring Data Graph setup in Virgo (based
>> on Equinox).
>>
>> Regarding the error with the missing lucene index Provider
>> (java.lang.IllegalArgumentException: No index provider 'lucene' found)
>> I also would like to refer to this "discussion" here:
>> https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325
>> I also had the "No index provider 'lucene' found" error with neo4j
>> 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl
>> package, which is not working with 1.4. Instead I just registered an
>> instance of LuceneIndexProvider from the lucene-index bundle as a osgi
>> service. After doing this, this index provider can be found as an OSGi
>> service by the kernel.
>> We currently register this service within our application, which is
>> probaby not the right solution. I think the lucene-index bundle should
>> export the LuceneIndexProvider service itself, shouldn't it?
>>
>> I also tried to get your example up and running, but I have a missing
>> dependency: "Failure to find
>> org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT". Which snapshot
>> repository does contain the tinybundles jar?
>>
>>
>> Best regards,
>> James
>>
>&g

Re: [Neo4j] OSGi and Neo4j - superbundle approach

2011-07-20 Thread Jean-Pierre Bergamin
Hello everyone

May I chime in here...

We are really interested to see neo4j working in an OSGi environment
esp. together with Spring Data Graph. After an unsuccessful attempt to
get it up and running a couple of weeks ago we gave it another chance
today after seeing this post and after a whole day of debugging and
fiddling around with manifests and template.mf and osgi.bnd we have  -
hurray - a running neo4j and Spring Data Graph setup in Virgo (based
on Equinox).

Regarding the error with the missing lucene index Provider
(java.lang.IllegalArgumentException: No index provider 'lucene' found)
I also would like to refer to this "discussion" here:
https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325
I also had the "No index provider 'lucene' found" error with neo4j
1.4. With 1.3, the workaround was to export the org.neo4j.index.impl
package, which is not working with 1.4. Instead I just registered an
instance of LuceneIndexProvider from the lucene-index bundle as a osgi
service. After doing this, this index provider can be found as an OSGi
service by the kernel.
We currently register this service within our application, which is
probaby not the right solution. I think the lucene-index bundle should
export the LuceneIndexProvider service itself, shouldn't it?

I also tried to get your example up and running, but I have a missing
dependency: "Failure to find
org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT". Which snapshot
repository does contain the tinybundles jar?


Best regards,
James


2011/7/20 Peter Neubauer :
> Yup,
> have pulled and can see it. Thanks! Will ask the Toni for a way to
> cleanly shut down the framework so we can get both tests working.
>
> /peter
>
> On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer
>  wrote:
>> Nicolas,
>> I am away for 2 days, will try it out after that. Thanks for chipping in!
>>
>> /peter
>>
>> Sent from my phone.
>>
>> On Jul 18, 2011 9:43 PM, "Nicolas Jouanin" 
>> wrote:
>>> Hi Peter,
>>>
>>> I've comited a new test case which work with a pre-built bundle.
>>> It currently fails because in OSGiTest class the first test case doesn't
>>> close the database, but if you remove the @Test before the first test case
>>> the second one will run and succeed.
>>> So the neo4j superbundle seems to work correctly, event if I don't know
>>> what's wrong when doing it by hand on the felix framework. This need more
>>> time to investigate.
>>> Don't hesitate to pull code if needed.
>>>
>>> Nicolas
>>>
>>> Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit :
>>>
 Nicolas,
 the best would be to be able to emulate this in a test, too. Maybe
 classloading issues? Maybe forking the PaxExam test will reproduce the
 issue, or running you Felix setup as a testcase to trigger this?

 Cheers,

 /peter neubauer

 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 - Your high performance graph database.
 http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin
  wrote:
> I've sent the CLA signup.
> The OSGiTest is working fine for me too. Problems come when taking the
> felix framework out of the box and deploying manually neo4j-osgi bundle 
> with
> another bundle containing the same activator class.
> I made sure to deploy same bundles but I get
> java.lang.IllegalArgumentException: No index provider 'lucene' found when
> registring the IndexService.
> I think i miss a bundle which is created automatically by pax during the
> test case. May be lucene is missing.
> What do you think
>
> Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit :
>
>> Hi Nicolas,
>> Have you been able to run
>>
>> https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java
>> properly? It actually is running on Equinox, so let me try it with
>> Felix ... back in a moment.
>>
>> Also, in order to pull your changes, could you sign up as a committer,
>> and send a mail according to
>> http://wiki.neo4j.org/content/About_Contributor_License_Agreement ?
>>
>>
>> Cheers,
>>
>> /peter neubauer
>>
>> 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 - Your high performance graph database.
>> http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
>> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>>
>>
>>
>> On Sun, Jul 17, 2011 at 3:02 PM, Nicol

Re: [Neo4j] Performance issues with small transactions on certain Linux installations

2011-07-14 Thread Jean-Pierre Bergamin
It seems to turn out that the IO systems of some machines have problem
writing the small transactions that neo4j is generating and that the
OS (Windows vs. Linux) does not much change here. Machines are either
fast on both OSes, or slow on both.
As you also pointed out, waiting for IO is the critical point. I ran a
profiler on one slow system and saw that the program was 95% of the
time in the call to sun.nio.ch.FileChannelImpl.force(boolean).

But what really baffles me is the fact that the differences are not in
the range of 50% to 200% but in an order of magnitude of 4000% to
10'000%! I've never seen similar behaviour with other db systems or
other benchmarks. What also surprises me is that we had not one system
that performs so-so. They all have 700 traversals/s or more or 50
traversals/s or less. Any performance tuning on such a slow linux
system as describe in the neo4j wiki had no effect.

We were evaluating MongoDB and ran tests with very small transactions
as well (inserts) on the same developer machines as the neo4j tests
and got performance differences of around 50% to 200% - which is
absolutely explainable, regarding the different hardware. This even

What makes me very, very nervous is the fact that the test runs very
poorly on a virtual machine on one of our XenServers. Has anyone maybe
a VMWare VM instance laying around where this simple test could be
performed as well? I'd be very interested to see some results with
other virtualization technologies.



Best regards,
James


2011/7/13 Michael Hunger :
> James,
>
> 10 tx/s in the write test seem to be not very much.
>
> A normal system should be able to run several hundred of them.
> With your small store-file I get:
>
> root@cineasts:~/write-test# ./run store logfile 33 1000 5000 100
> tx_count[100] records[312035] fdatasyncs[100] read[9.820132 MB] 
> wrote[19.640265 MB]
> Time was: 0.25
> 400.0 tx/s, 1248140.0 records/s, 400.0 fdatasyncs/s, 40223.26 kB/s on reads, 
> 80446.52 kB/s on writes
>
> From the statistics output you can also see that your system encounters a 
> io_wait of around 20% during the operation.
> That high percentage of io_waits increases the load of the system manifold 
> and causes it to have almost no cpu utilization because it is waiting _all 
> the time_ for the disk operations
> to finish.
>
> Perhaps you should have a look at : filesystem, disk-controller, interrupts, 
> etc. Unfortunately I'm no linux sysadmin guru, so I don't know which other 
> knobs
> affect the io-latency of your local disk. Perhaps someone else can chime in.
>
> For comparison you can also fire up some amazon ec2 instances and check your 
> test there.
>
> Cheers
>
> Michael
>
>
> Am 13.07.2011 um 13:58 schrieb Jean-Pierre Bergamin:
>
>> I ran the write_test on an ubuntu server 10.04 that performs bad with
>> our test app.
>> I first tried to use the 1GB store file as described here:
>> http://wiki.neo4j.org/content/Linux_Performance_Guide
>> I had the effect that a flush-x-x process got spawned even with large
>> transactions and the performance was very bad, probably because the
>> whole 1GB file cannot be cached in memory  (1.5 GB RAM in this
>> maschine).
>>
>> james@v4-test:~/write-test$ ./run ../store logfile 33 100 500 100
>> tx_count[100] records[27301] fdatasyncs[100] read[0.85919666 MB]
>> wrote[1.7183933 MB]
>> Time was: 279.747
>> 0.35746583 tx/s, 97.59175 records/s, 0.35746583 fdatasyncs/s,
>> 3.1450467 kB/s on reads, 6.2900934 kB/s on writes
>>
>>
>> Since the storefile of our test app is 51 bytes I reran the write_test
>> with a store file of 100K:
>>
>> james@v4-test:~$ dd if=/dev/urandom of=store bs=1K count=100
>> 100+0 records in
>> 100+0 records out
>> 102400 bytes (102 kB) copied, 0.0399093 s, 2.6 MB/s
>> james@v4-test:~$ dd if=store of=/dev/null bs=1K
>> 100+0 records in
>> 100+0 records out
>> 102400 bytes (102 kB) copied, 0.000379937 s, 270 MB/s
>>
>> With the smaller store file I got reasonable results:
>>
>> james@v4-test:~/write-test$ ./run ../store logfile 33 1000 5000 100
>> tx_count[100] records[286685] fdatasyncs[100] read[9.022336 MB]
>> wrote[18.044672 MB]
>> Time was: 9.935
>> 10.065425 tx/s, 28856.062 records/s, 10.065425 fdatasyncs/s, 929.9317
>> kB/s on reads, 1859.8634 kB/s on writes
>>
>> james@v4-test:~/write-test$ ./run ../store logfile 33 1000 2000 100
>> tx_count[100] records[148032] fdatasyncs[100] read[4.6587524 MB]
>> wrote[9.317505 MB]
>> Time was: 8.786
>> 11.381743 tx/s, 16848.623 records/s, 11.381743 fdatasyncs/s, 542.9732
>> kB/s on reads, 1085.9464 kB/s on writes
>>
>> james@v4-test:~/w

Re: [Neo4j] Performance issues with small transactions on certain Linux installations

2011-07-13 Thread Jean-Pierre Bergamin
   5.090.000.49   17.730.00   76.68

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  95.67 0.00 0.33  0  0
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   7.930.000.16   24.600.00   67.31

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  91.67 0.00 0.34  0  1
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   3.910.000.81   25.080.00   70.20

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  94.33 0.00 0.34  0  1
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   3.220.000.97   16.430.00   79.39

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  89.33 0.00 0.35  0  1
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   2.620.000.66   28.690.00   68.03

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  67.00 0.00 0.25  0  0
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   4.230.000.49   28.340.00   66.94

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  93.33 0.00 0.47  0  1
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
  13.580.000.33   19.540.00   66.56

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  89.67 0.00 0.34  0  1
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
  23.690.001.80   22.880.00   51.63

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  68.33 0.00 0.26  0  0
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   6.570.000.33   18.560.00   74.55

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  91.67 0.00 0.31  0  0
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   2.640.000.99   30.310.00   66.06

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  82.67 0.00 0.34  0  1
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   0.000.000.83   17.690.00   81.49

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  91.00 0.00 0.30  0  0
sdb   0.00 0.00 0.00  0  0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
   3.960.000.95   26.780.00   68.30

Device:tpsMB_read/sMB_wrtn/sMB_readMB_wrtn
sda  80.00 0.00 0.30  0  0


I'll try to run a profiler and see what the problem could be.

Any other ideas in the meantime?



Best regards
James


2011/7/13 Michael Hunger :
> James,
>
> I reran the tests with the binary JDK from oracle as well as the one 
> installed via apt-get.
>
> Both yielded the same good results.
>
> Did you re-run the "linux-write-test" on the different performing systems 
> (especially try to set it to small tx - 10 or so) ?
>
> Also please look into system configurations like file system, page-sizes etc.
>
> You can also try to run a profiler (like visualvm or yourkit to the remote 
> system) so that the bottleneck gets obvious.
>
> Thanks
>
> Michael
>
> Am 13.07.2011 um 12:06 schrieb Jean-Pierre Bergamin:
>
>> On Ubuntu, we installed the sun jdk with apt-get:
>>
>> $ sudo apt-get install python-software-properties
>> $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
>> $ sudo apt-get update
>> $ sudo apt-get install sun-java6-jdk
>>
>>
>> Best regards,
>> James
>>
>> 2011/7/13 Michael Hunger :
>>> James

Re: [Neo4j] Performance issues with small transactions on certain Linux installations

2011-07-13 Thread Jean-Pierre Bergamin
On Ubuntu, we installed the sun jdk with apt-get:

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk


Best regards,
James

2011/7/13 Michael Hunger :
> James,
>
> So you didn't install openjdk on the unix machines using apt-get but the 
> sun/oracle jdk binary?
>
> Cheers
>
> Michael
>
> Am 13.07.2011 um 11:49 schrieb Jean-Pierre Bergamin:
>
>> Hi Michael
>>
>> All systems at least have Suns JDK 1.6, but with different minor
>> numbers. On my Windows that runs normally fast, I have 1.6.0_22, on
>> CentOS which is slow, there is also 1.6.0_22. So I *believe* the
>> problem is not related to the JDK version.
>> The systems are all commodity hardware - a variety of newer Dektop and
>> Laptop maschines. I'll gather all specs and let you know.
>>
>> If you'd like to start the app with different JVM params, you'd need
>> to use exec:exec with java as the executable and specify the params in
>> the pom.xml.
>> See 
>> http://mojo.codehaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html
>>
>> We already experimented on one Linux instance with different
>> Memory-Settings etc, but the very low rate did not change. And the 7
>> nodes should not eat up too much memory anyway. ;-)
>> We also applied the tipps from the Linux Performance Guide on the
>> neo4j Wiki without any noticable changes.
>>
>>
>> Best regards,
>> James
>>
>>
>>
>> 2011/7/13 Michael Hunger :
>>> What version of the JDK are you using on the different systems?
>>>
>>> The maven exec goal doesn't define any JVM parameters?
>>>
>>> Could you try to explicitely set those to (for instance) "-server 
>>> -Xmx512m", different OS implementations of the jvm have different 
>>> mechanisms on
>>> selecting memory, etc.
>>>
>>> What are the memory / cpu / disk characteristics of the different systems?
>>>
>>> On my MacBook Air I get around 2800 traversals / sec.
>>>
>>> I'll look into it.
>>>
>>> Cheers
>>>
>>> Michael
>>>
>>> Am 13.07.2011 um 10:28 schrieb Jean-Pierre Bergamin:
>>>
>>>> 2011/7/13 Jean-Pierre Bergamin :
>>>>
>>>>> We have severe performance issues on Linux.
>>>>
>>>> We just ran the tests on another Windows 7 x64 Laptop and we also
>>>> faced very bad performance with just 26 traversals per second
>>>> (compared to 1000 on a other Windows machine).
>>>> So it is not a Linux problem per se, but this behaviour shows up on
>>>> some machines.
>>>>
>>>> Any thoughts?
>>>>
>>>>
>>>> Best regards,
>>>> James
>>>> ___
>>>> Neo4j mailing list
>>>> User@lists.neo4j.org
>>>> https://lists.neo4j.org/mailman/listinfo/user
>>>
>>> ___
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>>>
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Performance issues with small transactions on certain Linux installations

2011-07-13 Thread Jean-Pierre Bergamin
Hi Michael

All systems at least have Suns JDK 1.6, but with different minor
numbers. On my Windows that runs normally fast, I have 1.6.0_22, on
CentOS which is slow, there is also 1.6.0_22. So I *believe* the
problem is not related to the JDK version.
The systems are all commodity hardware - a variety of newer Dektop and
Laptop maschines. I'll gather all specs and let you know.

If you'd like to start the app with different JVM params, you'd need
to use exec:exec with java as the executable and specify the params in
the pom.xml.
See 
http://mojo.codehaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html

We already experimented on one Linux instance with different
Memory-Settings etc, but the very low rate did not change. And the 7
nodes should not eat up too much memory anyway. ;-)
We also applied the tipps from the Linux Performance Guide on the
neo4j Wiki without any noticable changes.


Best regards,
James



2011/7/13 Michael Hunger :
> What version of the JDK are you using on the different systems?
>
> The maven exec goal doesn't define any JVM parameters?
>
> Could you try to explicitely set those to (for instance) "-server -Xmx512m", 
> different OS implementations of the jvm have different mechanisms on
> selecting memory, etc.
>
> What are the memory / cpu / disk characteristics of the different systems?
>
> On my MacBook Air I get around 2800 traversals / sec.
>
> I'll look into it.
>
> Cheers
>
> Michael
>
> Am 13.07.2011 um 10:28 schrieb Jean-Pierre Bergamin:
>
>> 2011/7/13 Jean-Pierre Bergamin :
>>
>>> We have severe performance issues on Linux.
>>
>> We just ran the tests on another Windows 7 x64 Laptop and we also
>> faced very bad performance with just 26 traversals per second
>> (compared to 1000 on a other Windows machine).
>> So it is not a Linux problem per se, but this behaviour shows up on
>> some machines.
>>
>> Any thoughts?
>>
>>
>> Best regards,
>> James
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Performance issues with small transactions on certain Linux installations

2011-07-13 Thread Jean-Pierre Bergamin
2011/7/13 Jean-Pierre Bergamin :

> We have severe performance issues on Linux.

We just ran the tests on another Windows 7 x64 Laptop and we also
faced very bad performance with just 26 traversals per second
(compared to 1000 on a other Windows machine).
So it is not a Linux problem per se, but this behaviour shows up on
some machines.

Any thoughts?


Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Performance issues with small transactions on certain Linux installations

2011-07-13 Thread Jean-Pierre Bergamin
Hello neo4j-users

This issue has already been reported by Marco here
http://lists.neo4j.org/pipermail/user/2011-May/008822.html
But I allow myself to pick this up again in a new thread.

We have severe performance issues on Linux. Our proof of concept app
is up to 40 times slower on Linux then on Windows. I have created a
very simple app that demonstrates this behaviour. It creates 7 nodes
with relationships between them. It then starts a transaction,
traverses the nodes and sets a property on each node with a random
value during the traversal. After one traversal, the transaction is
finished.
This app has many small transactions, which is known to be not very
performant with neo4j. A performance gap of up to factor 40 between
systems seems more like a bug to me... ;-)

Some "Benchmarks":
- On a Windows 7 x64 PC we get around 1000 traversals/s, which is ok
and what to expect and fulfills our needs in terms of performance.
- On a PC with Arch-Linux, we get around 2500 traversals/s, which is
even better.

But then...
- On Ubuntu 10.04 Server x64 we get around 30 traversals/s. :-(
- On Ubuntu 10.10 x86 we get around 50 traversals/s. :-(
- On CentOS 5.6 x64 we get around 25 traversals/s. :-(

All tests have been done on commodity HW.

The sample app can be found here:
https://bitbucket.org/ractive/neo4j-traversal

It can be built and run with:
$ hg clone https://bitbucket.org/ractive/neo4j-traversal
$ cd neo4j-traversal
$ mvn compile exec:java

Do you have any clues what the reason for the very bad performance on
some linux installations could be?
If you just have a linux installation lying around, could you verify
or deny the bad performance on Linux?



Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Graph in an OSGi environment

2011-05-24 Thread Jean-Pierre Bergamin
Peter,
The classes that Martin Hunger listed are the offending ones.


Best regards,
Jean-Pierre


2011/5/23 Peter Neubauer :
> Jean-Pierre,
> do you know which classes exactly are the offending ones in neo4j *impl?
> Would like to know in order to either avoid suing them or move them into the
> API.
>
> Cheers,
>
> /peter neubauer
>
> 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               - Your high performance graph database.
> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
> On Mon, May 23, 2011 at 3:44 PM, Jean-Pierre Bergamin
> wrote:
>
>> I have not spent much more time trying to get SDG running as a bundle
>> any more. I'll give it another shot today or tomorrow and let you know
>> how I'm proceeding.
>>
>> What definitively has to be done is fixing the package imports of SDG
>> and the package exports of neo4j (see
>> https://jira.springsource.org/browse/DATAGRAPH-88) so that SDG is not
>> using *.impl.* package of neo4j anymore. Maybe some of the classes
>> that are publicly used in SDG must be moved out of the *.impl.*
>> package in neo4j.
>>
>>
>>
>> Best regards,
>> James
>>
>>
>> 2011/5/20 Peter Neubauer :
>> > Hi there,
>> > any solution to this or do we need to dig deeper here?
>> >
>> > Cheers,
>> >
>> > /peter neubauer
>> >
>> > 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               - Your high performance graph
>> database.
>> > http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
>> > http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>> >
>> >
>> > On Mon, May 16, 2011 at 3:28 PM, Jean-Pierre Bergamin
>> > wrote:
>> >
>> >> This could be the problem, yes. The "repository factories" that create
>> >> the repositories from the interface definitions would need to import
>> >> the domain specific packages that contain the interfaces to have
>> >> access to them - which requires buddy loading.
>> >>
>> >> It seems as if the CGLIB enhanced class
>> >> org.springframework.data.graph.neo4j.config.Neo4jConfiguration cannot
>> >> be created when the app starts up. This is the relevant part of the
>> >> log file:
>> >>
>> >> [2011-05-16 15:10:49.467] region-dm-3
>> >> o.s.beans.factory.support.DefaultListableBeanFactory
>> >> Creating shared instance of singleton bean
>> >> 'org.springframework.data.graph.neo4j.config.Neo4jConfiguration#0'
>> >> [2011-05-16 15:10:49.467] region-dm-3
>> >> o.s.beans.factory.support.DefaultListableBeanFactory
>> >> Creating instance of bean
>> >> 'org.springframework.data.graph.neo4j.config.Neo4jConfiguration#0'
>> >> [2011-05-16 15:10:49.471] region-dm-3
>> >> org.springframework.beans.factory.annotation.InjectionMetadata
>> >> Found injected element on class
>> >>
>> >>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]:
>> >> AutowiredFieldElement for private javax.validation.Validator
>> >> org.springframework.data.graph.neo4j.config.Neo4jConfiguration.validator
>> >> [2011-05-16 15:10:49.471] region-dm-3
>> >> org.springframework.beans.factory.annotation.InjectionMetadata
>> >> Found injected element on class
>> >>
>> >>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]:
>> >> AutowiredMethodElement for public void
>> >>
>> >>
>> org.springframework.data.graph.neo4j.config.Neo4jConfiguration.setGraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService)
>> >> [2011-05-16 15:10:49.471] region-dm-3
>> >> org.springframework.beans.factory.annotation.InjectionMetadata
>> >> Found injected element on class
>> >>
>&g

Re: [Neo4j] Spring Data Graph in an OSGi environment

2011-05-23 Thread Jean-Pierre Bergamin
I have not spent much more time trying to get SDG running as a bundle
any more. I'll give it another shot today or tomorrow and let you know
how I'm proceeding.

What definitively has to be done is fixing the package imports of SDG
and the package exports of neo4j (see
https://jira.springsource.org/browse/DATAGRAPH-88) so that SDG is not
using *.impl.* package of neo4j anymore. Maybe some of the classes
that are publicly used in SDG must be moved out of the *.impl.*
package in neo4j.



Best regards,
James


2011/5/20 Peter Neubauer :
> Hi there,
> any solution to this or do we need to dig deeper here?
>
> Cheers,
>
> /peter neubauer
>
> 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               - Your high performance graph database.
> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
> On Mon, May 16, 2011 at 3:28 PM, Jean-Pierre Bergamin
> wrote:
>
>> This could be the problem, yes. The "repository factories" that create
>> the repositories from the interface definitions would need to import
>> the domain specific packages that contain the interfaces to have
>> access to them - which requires buddy loading.
>>
>> It seems as if the CGLIB enhanced class
>> org.springframework.data.graph.neo4j.config.Neo4jConfiguration cannot
>> be created when the app starts up. This is the relevant part of the
>> log file:
>>
>> [2011-05-16 15:10:49.467] region-dm-3
>> o.s.beans.factory.support.DefaultListableBeanFactory
>> Creating shared instance of singleton bean
>> 'org.springframework.data.graph.neo4j.config.Neo4jConfiguration#0'
>> [2011-05-16 15:10:49.467] region-dm-3
>> o.s.beans.factory.support.DefaultListableBeanFactory
>> Creating instance of bean
>> 'org.springframework.data.graph.neo4j.config.Neo4jConfiguration#0'
>> [2011-05-16 15:10:49.471] region-dm-3
>> org.springframework.beans.factory.annotation.InjectionMetadata
>> Found injected element on class
>>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]:
>> AutowiredFieldElement for private javax.validation.Validator
>> org.springframework.data.graph.neo4j.config.Neo4jConfiguration.validator
>> [2011-05-16 15:10:49.471] region-dm-3
>> org.springframework.beans.factory.annotation.InjectionMetadata
>> Found injected element on class
>>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]:
>> AutowiredMethodElement for public void
>>
>> org.springframework.data.graph.neo4j.config.Neo4jConfiguration.setGraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService)
>> [2011-05-16 15:10:49.471] region-dm-3
>> org.springframework.beans.factory.annotation.InjectionMetadata
>> Found injected element on class
>>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]:
>> AutowiredMethodElement for public void
>>
>> org.springframework.data.graph.neo4j.config.Neo4jConfiguration.setEntityManagerFactory(javax.persistence.EntityManagerFactory)
>> [2011-05-16 15:10:49.471] region-dm-3
>> o.s.beans.factory.support.DefaultListableBeanFactory
>> Eagerly caching bean
>> 'org.springframework.data.graph.neo4j.config.Neo4jConfiguration#0' to
>> allow for resolving potential circular references
>> [2011-05-16 15:10:49.471] region-dm-3
>> org.springframework.beans.CachedIntrospectionResults
>> Getting BeanInfo for class
>>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]
>> [2011-05-16 15:10:49.472] region-dm-3
>> org.springframework.osgi.util.DebugUtils
>> Could not find class
>>
>> [org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70aBeanInfo]
>> required by [neo4j.domain(com.example.neo4j.domain)] scanning
>> available bundles
>> [2011-05-16 15:10:49.472] region-dm-3
>> org.springframework.osgi.util.DebugUtils
>> Class is correctly imported as version [1.0.0], checking providing
>> bundles
>> [2011-05-16 15:10:49.476] region-dm-3
>> org.springframework.osgi

Re: [Neo4j] Modelling a fault tree

2011-05-16 Thread Jean-Pierre Bergamin
Thank you Peter for pointing this out. As we need a concept for
permissions anyway, this comes in very handy. :-)
Ideas from such an ACL implementation will also help us, modelling our
fault tree.


Best regards,
James

2011/5/13 Peter Neubauer :
> Jean-Pierre,
> this looks a lot like the deduction of resulting permissions in a nested
> Access Control List. There is a brief example on that at
> http://wiki.neo4j.org/content/ACL that might be in that direction?
>
> Cheers,
>
> /peter neubauer
>
> On Fri, May 13, 2011 at 2:20 AM, Jean-Pierre Bergamin
> wrote:
>
>> Dear neo4j users
>>
>> We are in the course of evaluating neo4j for our application. Our model is
>> quite similar to a fault tree (
>> http://en.wikipedia.org/wiki/Fault_tree_analysis), where states ("ok" or
>> "not_ok") in leaf nodes get pushed up the tree. There are rules what state
>> the parent gets, depending on the states of its children:
>> * the parent is only ok, when all children are ok ("and" conjunction)
>> * the parent is ok, when any child is ok ("or" conjunction)
>> * the parent is ok, when at least 3 of the 5 children are ok
>> * etc.
>>
>> We are now looking for ways to model such a fault tree so that those rules
>> can be applied.
>> Since we just started with neo4j I'd like to ask if there is a "good known
>> practice" to model someting like this, before we start to head in a totally
>> wrong direction.
>>
>>
>> Best regards,
>> James
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Graph in an OSGi environment

2011-05-16 Thread Jean-Pierre Bergamin
ationBeanInfo]
required by [neo4j.domain(com.example.neo4j.domain)] scanning
available bundles
[2011-05-16 15:10:49.487] region-dm-3
org.springframework.osgi.util.DebugUtils
Class is correctly imported as version [1.0.0], checking providing
bundles
[2011-05-16 15:10:49.491] region-dm-3
org.springframework.osgi.util.DebugUtils
Bundle [Spring Data Neo4J (org.springframework.data.neo4j)] exports
[org.springframework.data.graph.neo4j.config] as version
[1.1.0.BUILD-SNAPSHOT] but version [1.0.0] was required
[2011-05-16 15:10:49.492] region-dm-3
org.springframework.osgi.util.DebugUtils
Could not find class [java.lang.ObjectBeanInfo] required by
[neo4j.domain(com.example.neo4j.domain)] scanning available bundles
[2011-05-16 15:10:49.493] region-dm-3
org.springframework.beans.CachedIntrospectionResults
Caching PropertyDescriptors for class
[org.springframework.data.graph.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$775b2448$$EnhancerByCGLIB$$e7c2c330$$EnhancerByCGLIB$$4422c70a]
[2011-05-16 15:10:49.493] region-dm-3
org.springframework.beans.CachedIntrospectionResults
Found bean property 'class' of type [java.lang.Class]
[2011-05-16 15:10:49.493] region-dm-3
org.springframework.beans.CachedIntrospectionResults
Found bean property 'entityManagerFactory' of type
[javax.persistence.EntityManagerFactory]


2011/5/15 Neale Upstone :
>  In OSGi, missing classes can be down to which bundles are visible to
> the bundle doing the scanning.  In this case, whatever is doing the
> classpath scanning cannot see the bundle exporting your domain package.
>
>  From a number of years back, I remember having to use
> eclipse-registerbuddy to solve a classloader visibility issue.  I'm not
> sure what the standard approach to this became.  A quick search doesn't
> deliver anything definitive for bundle-buddypolicy, which I suspect is
> the standardised mechanism.
>
>
>
> On 13/05/2011 15:10, Jean-Pierre Bergamin wrote:
>> I just could resove some more issues.
>> First of all I had to excplicitely add an Import-Package directive in
>> the template.mf of our project for packages that are not recognized by
>> bundlor (as the one for the missing Neo4jConfiguration):
>>
>> Import-Package:
>>   org.springframework.data.graph.neo4j.config;version="[1.1.0, 1.2.0)",
>>   org.springframework.data.repository.support;version="[1.0.0, 1.2.0)",
>>   org.springframework.transaction.aspectj;version="[3.0, 3.1)"
>>
>> I also had to put Import-Pacakge statements for cglib packages to the
>> spring data neo4j bundle.
>>
>> The next problem I'm facing is that graph repositories cannot be
>> injected, because they seem not to be created by SDG:
>>
>> [2011-05-13 16:06:29.786] region-dm-0
>> Application context creation failure for bundle
>> 'com.example.neo4j.domain' version '0.0.1.BUILD-SNAPSHOT'.
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'serviceRepositoryImpl': Injection of
>> autowired dependencies failed; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Could not
>> autowire field: private com.example.neo4j.ServiceRepository
>> com.example.neo4j.ServiceRepositoryImpl.serviceRepository; nested
>> exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
>> No matching bean of type [com.example.neo4j.ServiceRepository] found
>> for dependency: expected at least 1 bean which qualifies as autowire
>> candidate for this dependency. Dependency annotations:
>> {@org.springframework.beans.factory.annotation.Autowired(required=true)}
>>       at 
>> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
>>       at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
>>       at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>>       at 
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>>       at 
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
>>       at 
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>       at 
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFa

Re: [Neo4j] Spring Data Graph in an OSGi environment

2011-05-13 Thread Jean-Pierre Bergamin
on.InjectionMetadata.inject(InjectionMetadata.java:84)
at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)
... 18 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean of type [com.example.neo4j.ServiceRepository] found
for dependency: expected at least 1 bean which qualifies as autowire
candidate for this dependency. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:920)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:789)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
at 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
... 20 common frames omitted


Any ideas about that?


Best regards,
James


2011/5/13 Jean-Pierre Bergamin :
> SDG is using bundlor to generate the MANIFEST.MF file.I already fixed
> the MANIFEST and the spring data neo4j bundle can now be resolved.
>
> But when the spring application context is loaded, the class
> "org.springframework.data.graph.neo4j.config.Neo4jConfiguration"
> cannot be found during bean postprocessing and aspectj magic (see
> stacktrace below).
> The class is available and exported. I checked that with clhas and
> clexport on the Virgo console. Does maybe the kernel space of Virgo
> has to to know the spring data neo4j bundle, because this aspectj
> "enhancements" are performed there?
>
>
> Best regards
> James
>
> [2011-05-12 16:44:23.865] region-dm-14                 
> Application context creation failure for bundle
> 'com.example.neo4j.domain' version '0.0.1.BUILD-SNAPSHOT'.
> java.lang.IllegalStateException: Cannot load configuration class:
> org.springframework.data.graph.neo4j.config.Neo4jConfiguration
>        at 
> org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:246)
>        at 
> org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:160)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:467)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281)
>        at 
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
>        at 
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
>        at 
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
>        at 
> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
>        at 
> org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
>
>
> 2011/5/13 Nicolas Jouanin 
>>
>> Well, at the minimum, it's only a question of adding some extra headers
>> (Bundle-Symbolic, Export-Package; ...) in the package MANIFEST and this can
>> be done automatically using the maven-bundle-plugin.
>> You can have a look at Neo4j pom 

Re: [Neo4j] Spring Data Graph in an OSGi environment

2011-05-13 Thread Jean-Pierre Bergamin
2011/5/13 Michael Hunger :
> Forwarded it to the AJ project lead Andy Clement, he knows this OSGi + AJ 
> stuff certainly better than me :)

Ok. Thank you so far for the help!


Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Graph in an OSGi environment

2011-05-13 Thread Jean-Pierre Bergamin
SDG is using bundlor to generate the MANIFEST.MF file.I already fixed
the MANIFEST and the spring data neo4j bundle can now be resolved.

But when the spring application context is loaded, the class
"org.springframework.data.graph.neo4j.config.Neo4jConfiguration"
cannot be found during bean postprocessing and aspectj magic (see
stacktrace below).
The class is available and exported. I checked that with clhas and
clexport on the Virgo console. Does maybe the kernel space of Virgo
has to to know the spring data neo4j bundle, because this aspectj
"enhancements" are performed there?


Best regards
James

[2011-05-12 16:44:23.865] region-dm-14 
Application context creation failure for bundle
'com.example.neo4j.domain' version '0.0.1.BUILD-SNAPSHOT'.
java.lang.IllegalStateException: Cannot load configuration class:
org.springframework.data.graph.neo4j.config.Neo4jConfiguration
at 
org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:246)
at 
org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:160)
at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479)
at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:467)
at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395)
at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281)
at 
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
at 
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
at 
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
at 
org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
at 
org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)



2011/5/13 Nicolas Jouanin 
>
> Well, at the minimum, it's only a question of adding some extra headers
> (Bundle-Symbolic, Export-Package; ...) in the package MANIFEST and this can
> be done automatically using the maven-bundle-plugin.
> You can have a look at Neo4j pom file or this second article :
> http://wiki.escapek.org/display/DEV/Create+OSGi+bundle+from+regular+jar+archive
>
>
>
> 2011/5/13 Michael Hunger 
>
> > The issue is about Spring Data Graph not being correctly packaged as OSGi
> > bundle / compatible jar.
> >
> > And I have neither the knowledge nor the resources at the moment to fix
> > that.
> >
> > So if any one of you can help out with that, this would be most welcome.
> >
> > Thanks
> >
> > Michael
> >
> > Am 13.05.2011 um 11:42 schrieb Nicolas Jouanin:
> >
> > > Hi,
> > >
> > > I've written an article [1] showing how to run neo4j embedded database
> > > inside an OSGi container. Starting from that I think you can create a
> > bundle
> > > which uses this database to create the appropriate Spring data
> > > configuration. I suppose that spring-data-graph is packaged as a OSGi
> > > compatible jar, so using spring-dm too should do it.
> > >
> > >
> > > [1]
> > http://wiki.escapek.org/display/DEV/Neo4j+community+edition+installation
> > >
> > > 2011/5/13 Michael Hunger 
> > >
> > >> I'm no expert in OSGi so I did just the minimal thing, adding bundlor
> > >> information to the maven build. This is obviously not successful enough.
> > >>
> > >> So I w

[Neo4j] Spring Data Graph in an OSGi environment

2011-05-13 Thread Jean-Pierre Bergamin
Dear neo4j community

I'm so free to cross post a question to this list that I already posted in
the spring forum (
http://forum.springsource.org/showthread.php?109267-Spring-Data-Graph-in-OSGi-environment),
since most of the SDG experts probably are subscribed to this list. ;-)
Could anyone get spring data graph successfully up and running in an OSGi
container?


Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Modelling a fault tree

2011-05-13 Thread Jean-Pierre Bergamin
Dear neo4j users

We are in the course of evaluating neo4j for our application. Our model is
quite similar to a fault tree (
http://en.wikipedia.org/wiki/Fault_tree_analysis), where states ("ok" or
"not_ok") in leaf nodes get pushed up the tree. There are rules what state
the parent gets, depending on the states of its children:
* the parent is only ok, when all children are ok ("and" conjunction)
* the parent is ok, when any child is ok ("or" conjunction)
* the parent is ok, when at least 3 of the 5 children are ok
* etc.

We are now looking for ways to model such a fault tree so that those rules
can be applied.
Since we just started with neo4j I'd like to ask if there is a "good known
practice" to model someting like this, before we start to head in a totally
wrong direction.


Best regards,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Traversing all relationship types

2011-05-13 Thread Jean-Pierre Bergamin
Thank you Peter. These examples are really helpful and up-to-date.


Best regards,
James

2011/5/11 Peter Neubauer 

> Jean-Pierre,
> we are in the process of moving the Getting started guides to
> docs.neo4j,org, along with a number of good examples, amongst others on
> traversal. You might find
> http://components.neo4j.org/neo4j-examples/1.4-SNAPSHOT/ interesting, too?
>
> Cheers,
>
> /peter neubauer
>
> 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   - Your high performance graph database.
> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
> On Wed, May 11, 2011 at 12:41 AM, Jean-Pierre Bergamin <
> jpberga...@gmail.com
> > wrote:
>
> > Thank you Tobias. This "new" traversal framework looks much more powerful
> > and "fluent" then the traverser I have been playing with so far. The
> > getting
> > started guide should definitively point to it.
> >
> >
> > Best regards,
> > James
> >
> >
> > 2011/5/11 Tobias Ivarsson 
> >
> > > There is a tentative new traversal API included in Neo4j that features
> > this
> > > functionality:
> > >
> > > org.neo4j.kernel.Traversal.description().expand(
> > >org.neo4j.kernel.Traversal.expanderForAllTypes( Direction.OUTGOING )
> > );
> > >
> > > You can read more about it here:
> > > http://wiki.neo4j.org/content/Traversal_Framework
> > >
> > > Cheers,
> > > Tobias
> > >
> > > On Wed, May 11, 2011 at 9:08 AM, Jean-Pierre Bergamin
> > > wrote:
> > >
> > > > Hello neo4j users
> > > >
> > > > I'm just diving into neo4j and playing around with graph algorithms
> and
> > > > traversers.
> > > > As a start, I just wanted to traverse the whole graph with all
> > > relationship
> > > > types in the OUTGOING direction. The traverse() method always expects
> a
> > > > RelationshipType.
> > > > Is there a simpler way to traverse all RelationshipTypes then
> building
> > up
> > > > an
> > > > array that contains all types and the outgoing direction (as
> described
> > > here
> > > > http://sujitpal.blogspot.com/2009/06/custom-traverser-for-neo4j.html
> )?
> > > >
> > > >
> > > > Thanks for the help,
> > > > James
> > > > ___
> > > > Neo4j mailing list
> > > > User@lists.neo4j.org
> > > > https://lists.neo4j.org/mailman/listinfo/user
> > > >
> > >
> > >
> > >
> > > --
> > > Tobias Ivarsson 
> > > Hacker, Neo Technology
> > > www.neotechnology.com
> > > Cellphone: +46 706 534857
> > > ___
> > > Neo4j mailing list
> > > User@lists.neo4j.org
> > > https://lists.neo4j.org/mailman/listinfo/user
> > >
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Traversing all relationship types

2011-05-11 Thread Jean-Pierre Bergamin
Thank you Tobias. This "new" traversal framework looks much more powerful
and "fluent" then the traverser I have been playing with so far. The getting
started guide should definitively point to it.


Best regards,
James


2011/5/11 Tobias Ivarsson 

> There is a tentative new traversal API included in Neo4j that features this
> functionality:
>
> org.neo4j.kernel.Traversal.description().expand(
>org.neo4j.kernel.Traversal.expanderForAllTypes( Direction.OUTGOING ) );
>
> You can read more about it here:
> http://wiki.neo4j.org/content/Traversal_Framework
>
> Cheers,
> Tobias
>
> On Wed, May 11, 2011 at 9:08 AM, Jean-Pierre Bergamin
> wrote:
>
> > Hello neo4j users
> >
> > I'm just diving into neo4j and playing around with graph algorithms and
> > traversers.
> > As a start, I just wanted to traverse the whole graph with all
> relationship
> > types in the OUTGOING direction. The traverse() method always expects a
> > RelationshipType.
> > Is there a simpler way to traverse all RelationshipTypes then building up
> > an
> > array that contains all types and the outgoing direction (as described
> here
> > http://sujitpal.blogspot.com/2009/06/custom-traverser-for-neo4j.html)?
> >
> >
> > Thanks for the help,
> > James
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
>
>
>
> --
> Tobias Ivarsson 
> Hacker, Neo Technology
> www.neotechnology.com
> Cellphone: +46 706 534857
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Traversing all relationship types

2011-05-11 Thread Jean-Pierre Bergamin
Hello neo4j users

I'm just diving into neo4j and playing around with graph algorithms and
traversers.
As a start, I just wanted to traverse the whole graph with all relationship
types in the OUTGOING direction. The traverse() method always expects a
RelationshipType.
Is there a simpler way to traverse all RelationshipTypes then building up an
array that contains all types and the outgoing direction (as described here
http://sujitpal.blogspot.com/2009/06/custom-traverser-for-neo4j.html)?


Thanks for the help,
James
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user